From 40755cc70c0ac5ffd45c6c6d6ff5e3759f8fb13d Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Sep 2021 03:07:47 +0900 Subject: [PATCH] fix bug --- src/client/directives/tooltip.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/directives/tooltip.ts b/src/client/directives/tooltip.ts index ee690558a..32d137b2e 100644 --- a/src/client/directives/tooltip.ts +++ b/src/client/directives/tooltip.ts @@ -36,7 +36,7 @@ export default { }); } - const show = e => { + self.show = () => { if (!document.body.contains(el)) return; if (self._close) return; if (self.text == null) return; @@ -60,7 +60,7 @@ export default { el.addEventListener(start, () => { clearTimeout(self.showTimer); clearTimeout(self.hideTimer); - self.showTimer = setTimeout(show, delay); + self.showTimer = setTimeout(self.show, delay); }, { passive: true }); el.addEventListener(end, () => { @@ -75,6 +75,11 @@ export default { }); }, + updated(el, binding) { + const self = el._tooltipDirective_; + self.text = binding.value as string; + }, + unmounted(el, binding, vn) { const self = el._tooltipDirective_; clearInterval(self.checkTimer);