vue3 print ts打印组件

依赖安装

npm install vue3-print-ts

全局注入

import { createApp } from 'vue'
import App from './App.vue'
import Print from 'vue3-print-ts'

const app = createApp(App)
app.directive("print", Print)

页面使用(element plus ui 例子)




文档说明

Parame Explain Type OptionalValue DefaultValue
ids Range print ID ,required value String String[]
standard Document type String String[] html5/loose/strict
extraHead Add DOM nodes in the node, example: String String[]
extraCss  New CSS style sheet, example: http://www.**.com/aa.css String -
printTitle  Content of label String -
beforePrint Callback function before calling printing tool, example: calback(event) VoidFunction -
afterPrint Callback function after calling printing tool, example: calback(event) VoidFunction -
showBackground print page show background style Boolean false

例子源代码:vue-sys-manage-el

vue3-print-ts组件:vue3-print-ts

你可能感兴趣的:(vue,typescript)