vue-tippy
Advanced tools
Comparing version 4.9.0 to 4.10.0
@@ -14,3 +14,3 @@ import tippy from 'tippy.js' | ||
export function useTippy (el, opts = {}) { | ||
export function useTippy (el, opts = {}, settings = { mount: true }) { | ||
const instance = ref(null) | ||
@@ -33,4 +33,3 @@ | ||
} | ||
onMounted(() => { | ||
const mount = () => { | ||
let element = el | ||
@@ -45,6 +44,11 @@ | ||
} | ||
if(element._isVue){ | ||
element = element.$el; | ||
if (!element) { | ||
return | ||
} | ||
if (element._isVue) { | ||
element = element.$el | ||
} | ||
if (isRef(opts.content)) { | ||
@@ -62,4 +66,14 @@ watch( | ||
init(element, reactive(opts)) | ||
}) | ||
} | ||
const unmount = () => { | ||
if (instance.value) { | ||
instance.value.destroy() | ||
} | ||
} | ||
if (settings.mount) { | ||
onMounted(mount) | ||
} | ||
onUnmounted(() => { | ||
@@ -87,2 +101,4 @@ if (instance.value) { | ||
return { | ||
mount, | ||
unmount, | ||
onMount, | ||
@@ -89,0 +105,0 @@ onUnmount, |
{ | ||
"name": "vue-tippy", | ||
"version": "4.9.0", | ||
"version": "4.10.0", | ||
"description": "Directive and Component wrapper for Tippy.js", | ||
@@ -5,0 +5,0 @@ "author": "Georges KABBOUCHI <georges.kabbouchi@gmail.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
438242
9610