hy-print
Version:
print for table
20 lines (18 loc) • 626 B
text/typescript
import type { DirectiveBinding } from 'vue'
import Print from './print'
import type { PrintType } from './types'
export default {
mounted(el: HTMLElement, binding: DirectiveBinding<PrintType>) {
el.addEventListener('click', () => {
const options = binding.value || {}
const printer = new Print({
element: options.id ? undefined : el,
id: options.id,
type: options.type,
markWater: options.markWater,
clone: options.clone ?? true
})
printer.init()
})
}
}