Complete the code to bind a click event using a directive with an argument.
<button v-on:[1]="handleClick">Click me</button>
v-bind instead of v-on for eventsThe v-on directive listens to DOM events. The argument click specifies the event type.
Complete the code to use a modifier that prevents the default action on a click event.
<a href="#" v-on:click.[1]="submitForm">Submit</a>
.stop which stops event propagation but not default actionThe .prevent modifier stops the default browser action, like following a link.
Fix the error in the directive by correctly adding a modifier to listen only once.
<button v-on:click[1]="doSomething">Click once</button>
.prevent or .stop instead of .onceThe .once modifier ensures the event handler runs only one time.
Fill both blanks to bind an input event with modifiers to trim and lazy update.
<input v-on:input[1][2]="updateValue">
.prevent which stops default action unnecessarilyThe .trim modifier removes whitespace, and .lazy updates the model only on change.
Fill all three blanks to bind a keydown event with argument and modifiers for ctrl key and once.
<input v-on:keydown[1].[2][3]="handleKey">
.shift instead of .ctrl when Ctrl key is neededThe argument .enter listens for Enter key, .ctrl requires Ctrl key pressed, and .once runs handler once.