Join Michael Sullivan for an in-depth discussion in this video Combining v-for with event handling, part of Learning Vue.js.
- [Instructor] In this video, we'll be mostly…just combining two techniques that we've already covered.…But I'll also mention one new attribute…that will come into play once we do so.…All we're gonna do is add another column to our table…with a button that we can click to remove a row.…And then we'll discuss some of the implications…involved with doing that.…First, we'll add a column header that says remove…and then we'll add another table cell…with a button element.…This will also say remove…and…if we add the button and button warning classes…we'll get a nice, rounded yellow button.…
Next we'll add a V on click handler…that calls a function we haven't written yet,…which we'll just call remove.…And remember the shorthand for V on click…is just at sign click.…And what we want this function to do…is to remove an item from our array of asteroids.…To do that, we'll need to pass the index…of the item in the array.…As long as we're inside this TR,…the variable index will be in scope…with the value of the current index…
- 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.