damianstasik / vue-svg-loader

🔨 webpack loader that lets you use SVG files as Vue components
https://vue-svg-loader.js.org
MIT License
645 stars 86 forks source link

nuxt3 can use? #200

Open delete-rain opened 1 year ago

delete-rain commented 1 year ago

next3 can use vue-svg-loader ? How to do ?

aleavikraman commented 1 year ago

I got it sort of working based on some other solutions people had.

in your nuxt.js.config add import svgLoader from "vite-svg-loader"

vite: { plugins: [ svgLoader({ /* ... */ }) ] },

Then in your component you just import the svg

import doodleSVG from "../public/orange-dog.svg";

and add it to your template <doodleSVG />