Vue: getting started

Lesson 04 · 10 min

Events and modifiers

@click calls a function. .prevent on a form, otherwise a reload.

10 minLesson 4 of 8Practice includedAsk AI on any point

@click="save" passes the event as the first argument if the function expects it. @click="save(id)" is fine too: Vue calls it with that id. Modifiers: @submit.prevent = preventDefault. @click.stop stops bubbling. Don't put heavy logic right into the template as a long line.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.