UPDATE
before modification
dataIcon: " @/images/flag-ukraine.svg"
after modification
dataIcon: require("@/assets/svg/flag-ukraine.svg"),
notable change with require()
I am using Materialize CSS select. When I use a URL for dataIcon like "http....", the code works fine. However, when I try to add a local file path, nothing seems to work. How can I specify the correct path for local files?
<div class="input-field col s12">
<select ref="selectCategory" class="icons">
<option
v-for="lang in languages"
:key="lang.id"
:value="lang.langI"
:data-icon="lang.dataIcon"
>{{lang.lang}}</option>
</select>
</div>
this represents the data
data: () => ({
date: new Date(),
interval: null,
dropdown: null,
languages: [
{
lang: "Українська",
langId: "uk-UA",
dataIcon:
" @/images/flag-ukraine.svg"
},
{
lang: "English",
langId: "en-US",
dataIcon:
"https://images.ua.prom.st/1440764527_saharnaya-kartinka-lyubov.jpg"
}
]
})
Screenshot link