Answers for "v-on preventdefault vue"

0

vuejs form prevent default event

<form
	action="/"
	v-on:submit.prevent="yourFunction"
>
      ...
</form>
Posted by: Guest on March-29-2021
2

on:click.prevent in vue

const app = new Vue({
  data: () => ({}),
  methods: {
    myMethod: function myMethod(ev) {
      console.log(ev); // MouseEvent { ... }
    }
  },
  template: `
    <div>
      <a v-on:click.prevent="myMethod($event)" href="/">Click Me</a>
    </div>
  `
});
Posted by: Guest on October-28-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language