From 8f18ce63f8bd146532d8939809c4d06c47d81afd Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 3 Nov 2021 19:47:53 +0100 Subject: [PATCH] chore: add uninstall to shortcut directive --- src/directives/shortcut.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/directives/shortcut.ts b/src/directives/shortcut.ts index 24824d477..30b1f1ce4 100644 --- a/src/directives/shortcut.ts +++ b/src/directives/shortcut.ts @@ -1,10 +1,13 @@ import {Directive} from 'vue' -import {install} from '@github/hotkey' +import {install, uninstall} from '@github/hotkey' const directive: Directive = { mounted(el, {value}) { install(el, value) }, + beforeUnmount(el) { + uninstall(el) + }, } export default directive