Home

Search IconIcon to open search

Vue directives (advanced)

Modifiers are special postfixes denoted by a dot, which indicate that a directive should be bound in some special way. For example, the .prevent modifier tells the v-on directive to call event.preventDefault() on the triggered event:

1
<form @submit.prevent="onSubmit">...</form>

Dynamic arguments:

1
2
3
4
<a v-bind:[attributeName]="url"> ... </a>

<!-- shorthand -->
<a :[attributeName]="url"> ... </a>