1<button v-on:click="warn('Form cannot be submitted yet.', $event)">
2 Submit
3</button>
4
5
6
7// ...
8methods: {
9 warn: function (message, event) {
10 // now we have access to the native event
11 if (event) {
12 event.preventDefault()
13 }
14 alert(message)
15 }
16}