I've been diving into Vue.js by following a YouTube channel, but the video was uploaded last year and I think it might not be working properly due to changes in VueJS itself. It would be really helpful if anyone could assist me with this.
Here is the codeio link: http://codepen.io/myrgato/pen/BWWxdQ
HTML
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7c1c2d2f78599859985">[email protected]</a>"></script>
<div id="app">
<button @click="increment">Increment</button>
<p>Counter: {{counter}}</p>
<p>Clicks: {{clicks}}</p>
</div>
JS
new Vue({
el: '#app',
data: {
counter: 0,
clicks: 0
},
methods: {
increment(){
this.clicks++;
}
},
computed: {
counter(){
return this.clicks * 2;
}
}
});
It's designed to calculate the number of clicks and then use a computed property to display a counter that is equal to clicks multiplied by two. However, for some reason, it's not functioning as expected.