sam3d/vue-svg

.svg?inline outputs src="[object Module]"

jordinebot opened this issue ยท 3 comments

I was trying your plugin (it's amazing, thanks!) in a new Vue CLI 3 default project. I've just did vue add svg and it works perfect if I use the option ?data, but I'd like to inline my SVG, so I tried...

<img src="@/assets/folder/asset.svg?inline">

and I got:

<img data-v-577233af="" src="[object Module]">

Any idea of what might I be doing wrong? Thank you!

sam3d commented

Wow thank you for your interest in my plugin!

You can't include an svg ?inline the same way you can using ?data, as it essentially imports it as a Vue component. The relevant section from the README (linked below) should point you in the right direction, let me know if you have any more questions ๐Ÿ˜„

https://github.com/sam3d/vue-svg#inline-svg-element

Oh, thank you so much. This happens for not reading before! I'm sorry! ๐Ÿ˜

sam3d commented

No problem ๐Ÿ˜„