I have a v-for loop in vue. I would like to use the array item value as part my src path like so:
<button
v-for="tab in tabs"
v-bind:key="tab"
v-on:click="getSportsData( tab )"
>
<img src="./src/img/" + tab + ".png">
</button>
In Vue.js:
data() {
return {
tabs: ["MLB", "NFL", "NBA"],
won: false,
etc..
}
I have tried a computed property but no good.I get error that "tab" is not defined. any idea's on how to use the "tab' value for my source path. Thanx.