Skip to content

Commit d3c3b3d

Browse files
committed
fix: some directive tooltips not working
1 parent 3b86637 commit d3c3b3d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/floating-vue/src/directives/v-tooltip.ts

+4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ export function getOptions (el, value, modifiers) {
4040
}
4141

4242
interface Directive {
43+
id: number
4344
options: Ref<any>
4445
shown: Ref<boolean>
4546
}
4647

4748
let directiveApp: App
4849
let directives: Ref<Directive[]>
50+
let uid = 0
4951

5052
function ensureDirectiveApp () {
5153
if (directiveApp) return
@@ -64,6 +66,7 @@ function ensureDirectiveApp () {
6466
return h(TooltipDirective, {
6567
...directive.options,
6668
shown: directive.shown.value || directive.options.shown,
69+
key: directive.id,
6770
})
6871
})
6972
},
@@ -83,6 +86,7 @@ export function createTooltip (el, value, modifiers) {
8386
const shown = ref(false)
8487

8588
const item = {
89+
id: uid++,
8690
options,
8791
shown,
8892
}

0 commit comments

Comments
 (0)