0👍
Quick reading,
In vue, everything defined in data() is reactive, so you get auto-rendering and dynamic binding for free.
Here is an example, you can adapt it to your case.
https://jsfiddle.net/coligo/49gptnad/
<div id="vue-instance">
<ul>
<template v-for="com in comments">
<li>
<button @click="com.votes++">Upvote !</button>
{{ com.votes }} - {{ com.subject }}
</li>
</template>
</ul>
</div>
var vm = new Vue({
el: '#vue-instance',
data: {
comments: [
{ votes: 0, subject: 'Yolo'},
{ votes: 0, subject: 'Kierkegaard rocked babe'}
]
},
});
More on this : https://v2.vuejs.org/v2/guide/reactivity.html, check the docs, Evan You made an awesome work to make it look clear and nice.
- [Vuejs]-Can't add TimePicker component from 'element-ui' library. How To add it correctly?
- [Vuejs]-Can't add TimePicker component from 'element-ui' library. How To add it correctly?
Source:stackexchange.com