I need assistance with updating a <textarea>
element in my Vue application. Currently, I have the textarea bound to some data in my state. However, when a button is clicked, I want the existing data in the textarea to fade out and be replaced with new data that fades in.
HTML
<button id="submit-button" v-on:click="changeData">Change</button>
<textarea id="dataoutput" rows="14" cols="90" v-model="output" readonly>{{ output }}</textarea>
JS
var app = new Vue({
el: '#app',
data: {
output: "Original data output here"
},
methods: {
changeData: function() {
// perform calculations
this.output = // new data
}
}
});
I've been exploring Vue transitions and CSS animations but I'm struggling to implement the desired effect. Any guidance on how to achieve this would be greatly appreciated.