mirror of
https://github.com/koel/koel
synced 2024-12-20 01:23:16 +00:00
7 lines
224 B
TypeScript
7 lines
224 B
TypeScript
import { Directive } from 'vue'
|
|
|
|
export const clickaway: Directive = {
|
|
created (el: HTMLElement, binding) {
|
|
document.addEventListener('click', (e: MouseEvent) => el.contains(e.target as Node) || binding.value())
|
|
}
|
|
}
|