From 3c89147ee25f1afb84565a9280b333c0969dc806 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sun, 22 Aug 2021 14:10:12 +0200 Subject: [PATCH] fix: new directive syntax see: https://v3.vuejs.org/guide/migration/custom-directives.html --- src/directives/focus.js | 2 +- src/directives/tooltip.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/directives/focus.js b/src/directives/focus.js index ac5a5460..11d01698 100644 --- a/src/directives/focus.js +++ b/src/directives/focus.js @@ -1,6 +1,6 @@ export default { // When the bound element is inserted into the DOM... - inserted: (el, {modifiers}) => { + mounted: (el, {modifiers}) => { // Focus the element only if the viewport is big enough // auto focusing elements on mobile can be annoying since in these cases the // keyboard always pops up and takes half of the available space on the screen. diff --git a/src/directives/tooltip.js b/src/directives/tooltip.js index ebcdd03d..cfdf05cb 100644 --- a/src/directives/tooltip.js +++ b/src/directives/tooltip.js @@ -22,7 +22,7 @@ const calculateArrowTop = (top, tooltip) => { const createdTooltips = {} export default { - inserted: (el, {value, modifiers}) => { + mounted(el, {value, modifiers}) { // First, we create the tooltip and arrow elements const tooltip = document.createElement('div') tooltip.style.position = 'fixed' @@ -74,7 +74,7 @@ export default { arrow: arrow, } }, - unbind: el => { + unmounted(el) { if (typeof createdTooltips[el] !== 'undefined') { createdTooltips[el].tooltip.remove() createdTooltips[el].arrow.remove()