This is my data:
data: () => ({
html: [
"../assets/html.png",
"../assets/css.png",
"../assets/scss.png",
"../assets/materialize.png"
]
})
I loop through like this, which shows the text stored in my data object:
<p v-for="img in html" :key="img">{{img}}</p>
However I can not use interpolation inside elements, so the following code does not work.
<v-flex xs6 md3 v-for="img in html" :key="img">
<img src={{img}} alt />
</v-flex>
How can I do this?
Edit: No errors, but not working yet: The HTML link looks like this (working):
</v-flex>
<v-flex xs6 md3><img src=../assets/html.png alt /></v-flex>
</v-layout>
src="/img/html.6ec9ec76.png"
Rendered by vue: src="../assets/materialize.png
Vue does not handle it correctly it seems!
{{ }}syntax, but to interpolate inside the opening tag, you've to use thev-binddirective, or the syntactic sugar with a colon only:.v-bind:src="img", or:src="img"instead ofsrc={{img}}