Exploring this particular situation
In a .vue file within the template
<div v-for="(tweet, index) in tweets">
<div class="each_tweet">
<textarea v-on:keyup="typing(index)"
placeholder="Share your thoughts">{{ tweet.content }}</textarea>
</div>
</div>
In the .vue file under <script>
export default {
methods: {
typing: function(index) {
console.log(this.tweets[index])//How can we grab the value of the textarea
}
},
data: function () {
return {
tweets: [{id: 0, content: ""},
{id: 1, content: ""}]
}
}
}
The inquiries that arise are:
1) Is there a method to synchronize the value of the textarea with the content of each tweet object? In this context, the value indicates the text input inside the textarea.
2) How can we access the value of the textarea within the "typing" method?