From the course: Vue.js 2: Working with APIs

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Looping through your state

Looping through your state - Vue.js Tutorial

From the course: Vue.js 2: Working with APIs

Start my 1-month free trial

Looping through your state

- [Instructor] Let's work on the code that is going to display the list of songs here, and push the information into this component. So I'm going to start off by getting rid of this old HelloWorld.vue file right here, and then I'm going to modify App.vue so that the current song is not right now sort of this hard-coded thing that we have. So I'm going to set this right now to null, and then I'm going to create a songs array here, that is going to have right now all of the songs. So I've got some data right here. This URL that I'm going to copy, just some JSON data with some additional songs. And I'm going to paste that right here. And let's go ahead and save this. Let's go ahead and collapse this, because it's really a bunch of stuff here. So we'll click on this little triangle which is a nice feature of this editor. And we'll need to go ahead and only display the currentSong, if the current-song variable has a value in…

Contents