Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Use v-for to loop through an array of objects and add Vue directives to provide interactivity to each and every item in the array.
Review
Dot notation to access a property in an array of objects:
Template
<ul>
<li v-for="item in items">
<a href="item.url">{{item.name}}</a>
</li>
</ul>
Data
new Vue({
el: '#app',
data: {
items: [
{
name: 'Chewie',
url: 'https://www.someurl.com'
},
{
name: 'Archibald',
url: 'https://www.someotherurl.com'
},
]
}
});
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
MoatazBellah Ghobashy
9,518 Points1 Answer
-
izzy goldman
12,542 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up