Raphael
Raphael
NNuxt
Created by Raphael on 10/10/2024 in #❓・help
Why does UButton icon 404 error unless icon is separately pre-loaded?
Relevant chunk of code:
ColorScheme placeholder="" tag="span">
<UButton
v-model="isDark" :icon="isDark ? 'i-fa-moon-o' : 'i-fa-sun-o'" @click="toggleColourMode"> </UButton>
</ColorScheme>
ColorScheme placeholder="" tag="span">
<UButton
v-model="isDark" :icon="isDark ? 'i-fa-moon-o' : 'i-fa-sun-o'" @click="toggleColourMode"> </UButton>
</ColorScheme>
By itself I get the error: "Failed to load resource: the server responded with a status of 404 ()" However it works if after the above I add:
<Icon name="fa:sun-o" class="w-0 h-0"></Icon>
<Icon name="fa:moon-o" class="w-0 h-0"></Icon>
<Icon name="fa:sun-o" class="w-0 h-0"></Icon>
<Icon name="fa:moon-o" class="w-0 h-0"></Icon>
Is there a less hacky way to preload icons? I tried loadIcons() but that didn't work. Thanks!!
7 replies