jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
585 stars 61 forks source link

Fix attributes inheritance #32

Closed Antti closed 2 years ago

Antti commented 2 years ago

For some reason, if you just return render function (and not JS object as a component), attribute inheritance doesn't work.

Fix it by returning a normal Vue component with render function instead of a plain render function

Fixes https://github.com/jpkleemans/vite-svg-loader/issues/29

jpkleemans commented 2 years ago

Hi, that's really great! How did you come up with it? Thanks 👍

Antti commented 2 years ago

Thanks!

I was trying to fix this issue in different ways, and I noticed that it fixed itself once I returned a JS object with a render function instead of the render function itself.