I have a Vue component where I have written a function to increase the value of likes
by 1 when a button is clicked. However, this functionality doesn't seem to be working as expected. I initially tried writing it directly inside the component like this `@click="this.likes++' but that did not work. After that, I created a method, but unfortunately that also does not seem to be working. Can anyone provide assistance with this issue?
Vue.component('task-list',{
template: '<div><button @click="ggg">click me</button>{{ likes }}</div>',
data(){
return{
likes:1
}
},
methods:{
ggg(){
this.likes++
}
}
});