import { VNodeDirective } from 'vue' ; interface CustomElement extends Element { handler : ( evt : Event ) => void ; } export default { bind ( el , binding ) { const elCustom = el as CustomElement ; elCustom . handler = ( evt ) => binding . value ( evt , el ) ; window . addEventListener ( 'resize' , elCustom . handler ) ; } , unbind ( el , binding ) { const elCustom = el as CustomElement ; window . removeEventListener ( 'resize' , elCustom . handler ) ; } } ;