# @xingyuelongchen/vue3-print

> Vue2和Vue3的打印插件, print! Good!

Latest version **0.0.4** (published 2021-04-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install @xingyuelongchen/vue3-print
pnpm add @xingyuelongchen/vue3-print
yarn add @xingyuelongchen/vue3-print
bun add @xingyuelongchen/vue3-print
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2021-04-21 |
| First published | 2021-04-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 264.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 星月龙辰 |
| Maintainers | xingyuelongchen |
| Keywords | print, vue3, vue, print |

## Links

- npm: https://www.npmjs.com/package/@xingyuelongchen/vue3-print
- Repository: https://gitee.com/xingyuelongchen/long
- npm.io page: https://npm.io/package/@xingyuelongchen/vue3-print

## Recent versions

- 0.0.4 (latest) — 2021-04-21
- 0.0.3 — 2021-04-21
- 0.0.2 — 2021-04-17
- 0.0.1 — 2021-04-17

## README

# @xingyuelongchen/vue3-print

支持 vue3 的打印插件

## 安装

```bash
npm i @xingyuelongchen/vue3-print --save
```

## 使用方式

#### 参数说明

```javascript
/* 参数：
 *      #id   Dom选择字符串
 *      或    参数对象
 *      { id:Dom对象，或者id字符串，不传参数打印整个窗口页面
 *       standard：文档类型,
 *       extraHead：head上的额外标签,
 *       extraCss：额外的css连接,
 *       popTitle：标题 }
 */
```

#### Global instruction 全局注册

```javascript
import Print from "@xingyuelongchen/vue3-print";
App.use(Print); // Vue3 注册插件
// Vue.use(Print);  // Vue2.x 注册插件

// 可直接在Dom上使用指令
<button v-print></button>

// or 组件内调用全局方法
this.$print()
```

#### Local instruction 局部调用

```javascript
import { DirPrint, Print } from "@xingyuelongchen/vue3-print";

// 注册指令
directives: {
  DirPrint,
}

// Dom上使用指令
<button v-print></button>

// or 直接调用 Print 方法
Print()
```

## Run demo

```

npm install
npm run serve
-Local: http://localhost:8080/

```

You can also pass in an object type `Objcet`

### API

- `id`: \*requisite Partial printing of the incoming ID
- `standard`: Document type, default is html5, optional `html5`, `loose`, `strict`
- `extraHead`: Additional tags attached to the head tag, separated by commas
- `extraCss`: Additional link connections, separated by commas
- `popTitle`: Title shows the title
- `endCallback()`: Callback events after printing

```

```

---
_Source: https://npm.io/package/@xingyuelongchen/vue3-print · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
