
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@lambo-design/shared
Advanced tools
这是一个简单方便的打印组件。
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('关闭了打印工具')
}
}
};
}
}
| Parame | Explain | Type | OptionalValue | DefaultValue |
|---|---|---|---|---|
| id | 打印元素的ID | String | — | — |
| standard | 文档类型(仅打印本地范围) | String | html5/loose/strict | html5 |
| extraHead | <head></head>在节点中添加DOM节点,并使用 ,(仅打印本地范围) | String | — | — |
| extraCss | <link> 新的CSS样式表,并使用 ,(仅打印本地范围) | String | — | - |
| popTitle | <title></title> 标签内容 (仅打印本地范围) | String | — | - |
| openCallback | 调用打印工具的成功回调函数 | Function | Returns the instance of Vue called at that time | - |
| closeCallback | 关闭打印工具成功的回调函数 | Function | Returns the instance of Vue called at that time | - |
| beforeOpenCallback | 调用打印工具前的回调函数 | Function | Returns the instance of Vue called at that time | - |
| url | 打印指定的URL。(不允许同时设置ID) | string | - | - |
| asyncUrl | Return URL through 'resolve()' and Vue | Function | - | - |
| preview | 预览工具 | Boolean | - | false |
| previewTitle | 预览工具标题 | String | - | '打印预览' |
| previewPrintBtnLabel | 预览工具按钮的名称 | String | - | '打印' |
| zIndex | 预览工具的CSS:索引 | String,Number | - | 20002 |
| previewBeforeOpenCallback | 启动预览工具前的回调函数 | Function | Returns the instance of Vue | - |
| previewOpenCallback | 完全打开预览工具后的回调函数 | Function | Returns the instance of Vue | - |
| clickMounted | 单击打印按钮的回调函数 | Function | Returns the instance of Vue | - |
源码存放在components\vue-print-nb\src\packages下,如果想修改可以参考以下文章:
FAQs
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.