vue-print-nb 回调怎么知道点击了确认还是取消?

vue-print-nb 回调怎么知道点击了确认还是取消?

怎么才能获取打印成功或者失败的回调呢?


回答:

看文档:vue-print-nb

export default {

data() {

return {

printLoading: true,

printObj: {

id: "printMe",

preview: true,

previewTitle: 'print Title', // The title of the preview window. The default is 打印预览

popTitle: 'good print',

extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",

extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',

previewBeforeOpenCallback (vue) {

console.log('正在加载预览窗口')

},

previewOpenCallback (vue) {

console.log('已经加载完预览窗口')

},

beforeOpenCallback (vue) {

vue.printLoading = true

console.log('打开之前')

},

openCallback (vue) {

vue.printLoading = false

console.log('执行了打印')

},

closeCallback (vue) {

console.log('关闭了打印工具')

}

}

};

}

}

以上是 vue-print-nb 回调怎么知道点击了确认还是取消? 的全部内容, 来源链接: utcz.com/p/934659.html

回到顶部