2π
I recommend you to read VueJS Events Docs, in there youβll get everything you need.
Thereβs an example of the docs:
<div id="example-2">
<!-- `greet` is the name of a method defined below -->
<button v-on:click="greet">Greet</button>
</div>
var example2 = new Vue({
el: '#example-2',
data: {
name: 'Vue.js'
},
// define methods under the `methods` object
methods: {
greet: function (event) {
// `this` inside methods points to the Vue instance
alert('Hello ' + this.name + '!')
// `event` is the native DOM event
if (event) {
alert(event.target.tagName)
}
}
}
})
- [Vuejs]-Add a button in every row to a b-table using template
- [Vuejs]-Nuxt 3 (Vue.js 3) component transitions not working
1π
Do it this way;
<v-btn color="primary" rounded @click.prevent="startQuiz">Start</v-btn>
methods:{
startQuiz(){
console.log('start')
}
}
π€banky
- [Vuejs]-How to convert timestamp, depends on user timezone?
- [Vuejs]-Vue get unique values from v-for looped iput text
Source:stackexchange.com