Closed Thomasan1999 closed 1 year ago
hi @Thomasan1999 , u can use useTippy
to extract types
import { useTippy } from 'vue-tippy';
const myRef = ref<ReturnType<typeof useTippy>>()
Thank you @KABBOUCHI. Though, I have noticed some differences in the useTippy
returned type and template component ref:
contentElem
and elem
, does this mean these properties should not be used in the external code?tippy
property has a Ref<Instance>
type while the exported tippy
from component has an Instance
typemissing contentElem and elem, does this mean these properties should not be used in the external code?
yes, its for internal use
tippy property has a Ref
type while the exported tippy from component has an Instance type
import { useTippy } from 'vue-tippy';
import { ref, UnwrapNestedRefs } from 'vue';
const myRef = ref<UnwrapNestedRefs<ReturnType<typeof useTippy>>>()
will do a refactor this weekend, needs to update the component type
I belive this should work after the refactor:
import { TippyComponent } from 'vue-tippy';
import { ref } from 'vue';
const myRef = ref<TippyComponent>()
I've tried using the new TippyComponent
type but there are missing hide
, show
functions, etc. Shouldn't they be used externally as well or is there another way how to access them via the new type?
plz, can u try v6.0.0-alpha.62
?
It's working now, thank you. 🙂
Any chance these updates broke the interactive
prop? Seems like that no longer works properly.
Any chance these updates broke the
interactive
prop? Seems like that no longer works properly.
plz can u try v6.0.0-alpha.63
?
Fixed :smile:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, if I want to use the Tippy component exported from the library via template ref, I can't tell TS compiler which type the ref uses. Looking into source code of the library, I've created an interface which would solve this issue: