JSFiddle - React, Tailwind, and code Playground
by badvz
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.14/vue.min.js"></script>
<html>
<body id="test-app">
<ul>
<li v-for="(itemObjKey, catalog) in catalogs">this index : {{itemObjKey}}</li>
</ul>,
<button v-on:click="start">Test</button>
</body>
</html>
JavaScript
var app = new Vue({
el: '#test-app',
data: {
catalogs: [{name: 'test 1'}, {name: 'test 2'}],
// itemObjKey:1,
},
methods: {
start: function () {
this.catalogs.push({name: 'test 3'});
}
}
});