jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
557 stars 59 forks source link

Support svg file exported from SVGator #15

Closed linusang closed 3 years ago

linusang commented 3 years ago

SVGator exports svg with script tags to do animation. When I import the svg in vite, it seems to omit the script tag in the svg file.

here is a sample file from SVGator https://1drv.ms/u/s!Ar0tMr5SCHnsjL9l3IHceXVWUhyIwQ?e=vY3X74

jpkleemans commented 3 years ago

Hi, the Vue compiler removes all <script> code from the SVG file, so you need to add the animation code to the component yourself. See https://www.svgator.com/help/getting-started/add-animated-svg-to-vue-js.