Renovamen / oh-vue-icons

A Vue component for importing inline SVG icons from different popular icon packs easily.
https://oh-vue-icons.js.org
Other
242 stars 22 forks source link

Icons do not appear on the page #39

Open reinaldofox opened 9 months ago

reinaldofox commented 9 months ago

In my project with Vite, Vue3/Composition API and Typescript the icons do not appear on the page. Do I need some svg loader?

alfaruqii commented 8 months ago

hey i have the same problem (javascript), did you already find any solution?

reinaldofox commented 8 months ago

hey i have the same problem (javascript), did you already find any solution?

Yep. I did it this way. In my components I did local import:

import { OhVueIcon as Vicon, addIcons } from "oh-vue-icons"
import { FaFlag } from "oh-vue-icons/icons"
addIcons(FaFlag)

And in the templates, just instantiate the icons you imported.

<template>
  <Vicon name="fa-flag"  />
</template>

This way it worked for me.