I need to get string values out of an array in a function. My declared component in my template is as follows:
<video-preview v-for="video in playlist" vid-id="how-do-I-get-the-string
-value-from-the-playlist-for-this-iteration"></video-preview>
Here is where playlist is declared in my data() { return {} } in my .vue file:
playlist: [
'videoID1',
'videoID2',
],
And here is my function in the methods section of the same .vue file:
playImageModal(video) {
Analytics('content_viewed', vidId)
// other functionality to play the video
}
I need to pass the current value of the playlist array into the Analytics() function in playImageModal(), however, I'm not quite sure how to access that value. I've looked at Vue.js documentation, and it is easy enough to do when my playlist array holds generic objects verses holding strings... I simply would do video.nameOfObjectAttribute when setting my vid-id value in my template. But how do I access these values when there is an array of strings?
vid-id="video"