fix: new directive syntax

see: https://v3.vuejs.org/guide/migration/custom-directives.html
This commit is contained in:
Dominik Pschenitschni 2021-08-22 14:10:12 +02:00
parent 78a5096e0d
commit 3c89147ee2
Signed by untrusted user: dpschen
GPG Key ID: B257AC0149F43A77
2 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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()