Rendering Lists in VueJs
A demo of rendering lists in VueJs using the v-for directive - http://coligo.io
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
<div id="vue-instance">
<button @click="assignData('test','new value for test')">
Press me
</button>
</div>
JavaScript
var vm = new Vue({
el: '#vue-instance',
data: {
test: '',
anotherVar: '',
newTest: ''
},
methods: {
assignData(prop,val) {
this[prop] = val;
console.log(this.test);
}
}
});