[Vuejs]-Display an object added to an array in a child component in Vue

0๐Ÿ‘

โœ…

My code was adding a new object to the array correctly and the update was passed to the child component correctly.

I was getting an error because the new object contained an empty array. trying to access it directly caused an error. Adding

<h2 v-if="loadedPlaylist.songs.length">{{loadedPlaylist.songs[activeTrack].name}}</h2>
    <h2 v-else>Add Songs below</h2>

fixed the error.

Leave a comment