1.0.6 • Published 2 years ago

@sugaz/v-print v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

vue 局部打印

快速运行

1. 安装

npm install --save @sugaz/v-print

2. 使用

import Vue from "vue";
import VPrint from "@sugaz/v-print";

Vue.use(VPrint);
<!-- 绑定到要触发元素 -->
<template>
  <main id="block">
    <p>打印这些内容</p>
  </main>
  <button @click="handlePrint">打 印</button>
</template>

<script>
export default {
  methods: {
    handlePrint() {
      this.$VPrint.print("block");
    }
  }
}
<script>

参数

print(id: string, options: Option)

Otpions:

ParamTypeDescribedefaultVersion
extraHeadstring附加在 head 标签上的额外元素,使用逗号分隔
extraCssstring额外的 css 逗号分隔
popTitlestringiframe 的 title
addPrintCssstringiframe 的 style
1.0.6

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago