vue submit preventdefault code example
Example 1: vuejs form prevent default event
<form
action="/"
v-on:submit.prevent="yourFunction"
>
...
</form>
Example 2: vue prevent button from submitting form
<form v-on:submit.prevent>
Example 3: event vueks
<div id="example-3">
<button v-on:click="say('salut')">Dire salut</button>
<button v-on:click="say('quoi')">Dire quoi</button>
</div>
Example 4: event vueks
new Vue({
el: '#example-3',
methods: {
say: function (message) {
alert(message)
}
}
})