Skip to content

Commit

Permalink
fix: some directive tooltips not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jan 20, 2022
1 parent 3b86637 commit d3c3b3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/floating-vue/src/directives/v-tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ export function getOptions (el, value, modifiers) {
}

interface Directive {
id: number
options: Ref<any>
shown: Ref<boolean>
}

let directiveApp: App
let directives: Ref<Directive[]>
let uid = 0

function ensureDirectiveApp () {
if (directiveApp) return
Expand All @@ -64,6 +66,7 @@ function ensureDirectiveApp () {
return h(TooltipDirective, {
...directive.options,
shown: directive.shown.value || directive.options.shown,
key: directive.id,
})
})
},
Expand All @@ -83,6 +86,7 @@ export function createTooltip (el, value, modifiers) {
const shown = ref(false)

const item = {
id: uid++,
options,
shown,
}
Expand Down

0 comments on commit d3c3b3d

Please sign in to comment.