1
0
tl-vikunja/src/directives/shortcut.ts
Dominik Pschenitschni d064f0acc0 fix import type
2022-07-04 21:50:48 +00:00

18 lines
391 B
TypeScript

import type {Directive} from 'vue'
import {install, uninstall} from '@github/hotkey'
import {isAppleDevice} from '@/helpers/isAppleDevice'
const directive: Directive = {
mounted(el, {value}) {
if (isAppleDevice() && value.includes('Control')) {
value = value.replace('Control', 'Meta')
}
install(el, value)
},
beforeUnmount(el) {
uninstall(el)
},
}
export default directive