Answer the question
In order to leave comments, you need to log in
How to convert string to src?
Hello.
I have a question.
There are pictures (which are output by v-for src cycles.
If you statically display the path src='assets/1.img' then everything is OK.
If, for example, I want to generate a path through computed or a filter, then a string is returned.
Therefore, I do: src=' computed.property '
And that doesn't work anymore, so how do you dynamically substitute the path?
<q-img
:src="name | srcImg(name)"
/>
if (value) {
value = value.trim().toLowerCase()
}
return `~assets/vendors/${value}.jpg`
Answer the question
In order to leave comments, you need to log in
https://quasar.dev/quasar-cli/handling-assets#gett...
Well, the operator | :src
clearly out of place .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question