0๐
โ
You have to return the data
value.
<div id="example-1">
<button v-on:click="counter += 1">Add 1</button>
<p>The button above has been clicked {{ counter }} times.</p>
</div>
<script>
var example1 = new Vue({
el: '#example-1',
data: data: function () {
return { // need to return things
counter: 0
}
},
})
</script>
Check this out here.
1๐
Data Must Be a Function
data: () => ({
counter: 0
})
Source:stackexchange.com