seiyable / vue-simple-svg

A simple Vue.js plugin that allows you to load a SVG image as an inline SVG with an access to change its fill colors
MIT License
80 stars 23 forks source link

Add usage as component #7

Closed shrpne closed 6 years ago

shrpne commented 6 years ago

I have added component export. Using vue-simple-svg as a component will make code splitting better.

I make it in a backward compatible way, but for now, Rollup throws a warning that mixing named and default exports is a bad practice. If you want, I can change to only named export, like this:

export {plugin as SimpleSVGPlugin, SimpleSVG as SimpleSVGComponent}

But in my opinion, mixed export is fine, because vue-simple-svg is not intended to be used as CommonJS module.

Also feel free to change naming, if you are not fully satisfied with it

seiyable commented 6 years ago

Thanks shrpne! This should be useful if you want to use it as a component.