New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@lambo-design/shared

Package Overview
Dependencies
Maintainers
1
Versions
334
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lambo-design/shared

latest
npmnpm
Version
1.0.0-beta.358
Version published
Maintainers
1
Created
Source

vue-print-nb打印组件

这是一个简单方便的打印组件。

用法

HTML:

 <div id="printMe">打印我</div>

<!-- 简单用法 -->
 <button v-print="'#printMe'">打印</button> 
<!-- 可传参用法 -->
 <button v-print="printObj">打印</button>

javascript:

export default {
    data() {
        return {
            printObj: {
              id:'' //需要打印的元素
              ignoreClass:'', //忽视打印的元素
              beforeOpenCallback (vue) {
                console.log('打开之前')
              },
              openCallback (vue) {
                console.log('执行了打印')
              },
              closeCallback (vue) {
                console.log('关闭了打印工具')
              }
            }
        };
    }
}

v-print API

ParameExplainTypeOptionalValueDefaultValue
id打印元素的IDString
standard文档类型(仅打印本地范围)Stringhtml5/loose/stricthtml5
extraHead<head></head>在节点中添加DOM节点,并使用 ,(仅打印本地范围)String
extraCss<link> 新的CSS样式表,并使用 ,(仅打印本地范围)String-
popTitle<title></title> 标签内容 (仅打印本地范围)String-
openCallback调用打印工具的成功回调函数FunctionReturns the instance of Vue called at that time-
closeCallback关闭打印工具成功的回调函数FunctionReturns the instance of Vue called at that time-
beforeOpenCallback调用打印工具前的回调函数FunctionReturns the instance of Vue called at that time-
url打印指定的URL。(不允许同时设置ID)string--
asyncUrlReturn URL through 'resolve()' and VueFunction--
preview预览工具Boolean-false
previewTitle预览工具标题String-'打印预览'
previewPrintBtnLabel预览工具按钮的名称String-'打印'
zIndex预览工具的CSS:索引String,Number-20002
previewBeforeOpenCallback启动预览工具前的回调函数FunctionReturns the instance of Vue-
previewOpenCallback完全打开预览工具后的回调函数FunctionReturns the instance of Vue-
clickMounted单击打印按钮的回调函数FunctionReturns the instance of Vue-

源码存放在components\vue-print-nb\src\packages下,如果想修改可以参考以下文章:

博客园

FAQs

Package last updated on 31 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts