shrpne / vue-inline-svg

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

Composition api only? #33

Open lebadapetru opened 3 years ago

lebadapetru commented 3 years ago

I've completely removed my option api from the build and thus it seems i cannot use your component. Is there any change to make it composition api only compatible?

The error i receive:

[Vue warn]: Property "svgElSource" was accessed during render but is not defined on instance. 
  at <InlineSvg src="build/media/icons/duotone/Navigation/Angle-double-left.svg" > 
  at <Aside> 
  at <Layout onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <RouterView> 
  at <App>

How i use the component:

import InlineSvg from "vue-inline-svg";

<inline-svg
            :src="'build/media/icons/duotone/Navigation/Angle-double-left.svg'"
          />

Package version: 3.0.0-beta.2

shrpne commented 3 years ago

For now, it uses options API like data, lifecycle hooks, and more. I believe there is no easy way to make it composition-api-only compatible. I guess inline-svg needs rewrite to work without options api.