Join Michael Sullivan for an in-depth discussion in this video Methods and event handling, part of Learning Vue.js.
- [Instructor] In this video we'll start to find out…how we could actually process this form input…and begin to work with our data in more interesting ways…than just displaying it or storing it in our Vue instance.…Since this button here is a submit button,…by default, it will refresh the page when I click it,…although it happens almost too quickly to notice.…Let's see if we can intercept that action by handling…the click event with a Vue method.…To handle an event with Vue, we use the v-on directive…followed by colon and the name of the event we're handling,…which is click in this case.…
Next, we'll use a new method that we'll have to create…called process.…We won't need to pass anything to it like the email value,…because that will be readily available…as a member of the same Vue instance.…Data goes in the data object,…and methods go in the methods object.…And we'll define a function called process.…This will just show an alert that says…what value was submitted.…
In the directives, we can just use property names…
- Adding Vue to a webpage
- Thinking declaratively with data binding
- Methods and event handling
- Adding dynamic style and class attributes
- Using CSS transitions and animations
- Using Vue components
- Vue CLI
Skill Level Intermediate
Web Programming Foundationswith Morten Rand-Hendriksen58m 44s Beginner
What you should know1m 29s
1. The Simplest Form
2. Essential Directives, Options, and Tools
3. Enhancing User Interfaces
4. Vue Components
Next steps2m 32s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.