Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quasar q-icon to use icon in assets folder

I have an icon named "home.svg" in my assets folder. how can I direct my q-icon component to get the icon inside the assets/ directory.

I have tried applying this way:

  <q-icon name="img:/assets/home.svg" class="text-dark" style="font-size: 32px;" />

but the image is not being rendered.

enter image description here

like image 856
Evan Avatar asked Oct 27 '25 12:10

Evan


1 Answers

You want to use the default slot. And see Asset Resolving Rules.

<q-icon class="text-dark" size="lg">
  <img src="~assets/home.svg" />
</q-icon>
like image 191
Yom T. Avatar answered Oct 30 '25 13:10

Yom T.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!