KABBOUCHI / vue-tippy

VueJS Tooltip powered by Tippy.js
https://vue-tippy.netlify.app
MIT License
722 stars 86 forks source link

useTippy on v-tippy directive triggers a Vue warning #294

Closed segevfiner closed 11 months ago

segevfiner commented 11 months ago
onUnmounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.

...
useTippy | @ | vue-tippy.esm-browser.js:4152
-- | -- | --
  | mounted | @ | vue-tippy.esm-browser.js:4459
...

Which happens from the call to useTippy done here https://github.com/KABBOUCHI/vue-tippy/blob/57dd5f2cc5fc6e14d51c2044f935013cd97ce188/src/directive/index.ts#L59 which internally does onUnmounted but we are not in the context of a component setup here when a directive is executed, which means this onUnmounted callback never gets called.

https://github.com/KABBOUCHI/vue-tippy/blob/57dd5f2cc5fc6e14d51c2044f935013cd97ce188/src/composables/useTippy.ts#L268-L270

@KABBOUCHI

KABBOUCHI commented 11 months ago

fixed plz update to v6.3.1

segevfiner commented 11 months ago

fixed plz update to v6.3.1

Thanks!