Join Michael Sullivan for an in-depth discussion in this video Adding component props, part of Learning Vue.js.
- [Instructor] Next, we're going to go back to…one of our original NASA api examples,…which was the astronomy picture of the day.…This is actually the code that we ended up with…in chapter 2 when we looked at loading initial data…using the created hook.…So let's turn this all into a simple component…that we can reuse or easily package up…and move to another page.…First, I'ma cut this image tag to the clipboard…because this is going to be the start of our template.…And I'ma replace this with a custom element…that I'll have to register in a moment.…
I'll call it a dash pod, in keeping with the…hyphenation convention.…Next, I'ma register this component with…vue dot component,…a dash pod and then I'ma pass in the options objects…with template and I can just wrap this image tag…from the clipboard in single quotes.…Next, I'ma take almost everything out of my view instance,…except the el option,…and just paste it right into the component options.…
Because all of this stuff is a pods specific.…Remember, we have to change data…
- 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.