From 18fa317ee70b5d570637407a3f8a2888ab27cb6f 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 ee690558af..32d137b2e2 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);