shrpne / vue-inline-svg

Dynamically loads an SVG source and inline <svg> element so you can manipulate the style of it
MIT License
175 stars 21 forks source link

Vue 3 - Devtools will show component as Anonymous Component #29

Closed MatthijsBe closed 3 years ago

MatthijsBe commented 3 years ago

Inside Vue 3 devtool, the inline SVG component will show up as: Anonymous Component To fix this a name should be provided: https://v3.vuejs.org/api/options-misc.html#name

shrpne commented 3 years ago

Is it new behavior in Vue 3? Looks like there is no such problem in Vue 2.

MatthijsBe commented 3 years ago

Is it new behavior in Vue 3? Looks like there is no such problem in Vue 2.

As far I know yes, you need to provide a component name with vue 3

syntag commented 3 years ago

I've tried both ways on Vue 3, importing it as a component globally and on the Vue page itself. Doesn't work as a plugin either. Here are the errors and warnings I get:

shrpne commented 3 years ago

@SYNTAG looks like you are using a version of vue-inline-svg intended for vue2. Vue3 version can be installed as vue-inline-svg@next

It is covered by dedicated docs section https://github.com/shrpne/vue-inline-svg#vue-v3

syntag commented 3 years ago

That worked, thank you for pointing that out. My apologies, I totally missed that in the docs.

shrpne commented 3 years ago

Fixed in 8a158a2b20c16021a897446a64cd1fd849709cf4