This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
2022-04-11 20:08:28 +00:00
|
|
|
import type {Directive} from 'vue'
|
2021-11-13 20:28:29 +00:00
|
|
|
import {install, uninstall} from '@github/hotkey'
|
|
|
|
|
2022-10-17 11:14:07 +00:00
|
|
|
const directive = <Directive<HTMLElement,string>>{
|
2021-11-13 20:28:29 +00:00
|
|
|
mounted(el, {value}) {
|
2022-09-07 17:55:59 +00:00
|
|
|
if(value === '') {
|
|
|
|
return
|
|
|
|
}
|
2021-11-13 20:28:29 +00:00
|
|
|
install(el, value)
|
|
|
|
},
|
|
|
|
beforeUnmount(el) {
|
|
|
|
uninstall(el)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export default directive
|