# cl-admin-export

> cool-admin: cl-admin-export

Latest version **1.0.6** (published 2021-03-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install cl-admin-export
pnpm add cl-admin-export
yarn add cl-admin-export
bun add cl-admin-export
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-03-24 |
| First published | 2021-02-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | icssoa |
| Maintainers | icssoa |
| Keywords | crud, admin, vue, export, excel, element-ui |

## Links

- npm: https://www.npmjs.com/package/cl-admin-export
- Homepage: https://github.com/cool-team-official/cl-admin-export
- npm.io page: https://npm.io/package/cl-admin-export

## Dependencies (2)

- [xlsx](https://npm.io/package/xlsx.md) ^0.15.6
- [file-saver](https://npm.io/package/file-saver.md) ^2.0.2

## Recent versions

- 1.0.6 (latest) — 2021-03-24
- 1.0.5 — 2021-02-24
- 1.0.4 — 2021-02-24
- 1.0.3 — 2021-02-24
- 1.0.2 — 2021-02-24
- 1.0.1 — 2021-02-22
- 1.0.0 — 2021-02-22

## README

# cl-admin-export 导出按钮

可导出当页表格的数据为 Excel 文件

## 安装

```shell
yarn add cl-admin-export
```

## 参数

| 参数           | 类型             | 说明                                      | 默认                         |
| -------------- | ---------------- | ----------------------------------------- | ---------------------------- |
| filename       | Function, String | 导出文件名                                | yyyy-MM-dd HH_mm_ss          |
| autoWidth      | Boolean          | 自动调节宽度                              | true                         |
| bookType       | String           | 类型                                      | xlsx                         |
| header         | Array            | 表头                                      | 默认使用 table.column[label] |
| fields         | Array            | 字段                                      | 默认使用 table.column[prop]  |
| data           | Function, Array  | 数据                                      | 默认使用 page 获取数据       |
| maxExportLimit | Number           | 最大导出条数，不传或者小于等于 0 为不限制 | 0                            |
| size           | String           | 按钮尺寸                                  | mini                         |
| disabled       | Boolean          | 是否禁用                                  | false                        |
| type           | String           | 按钮类型                                  | default                      |
| plain          | Boolean          | 按钮镂空                                  | false                        |
| round          | Boolean          | 按钮圆角                                  | false                        |
| circle         | Boolean          | 按钮圆形                                  | false                        |
| icon           | String           | 按钮图标                                  | null                         |

## 示例

全局使用

```js
// cool/index.js

import AdminExport from "cl-admin-export";

export default {
	components: [["admin-export", AdminExport]],
};
```

注册后就能使用 `cl-export-btn` 组件

```html
<template>
	<cl-crud>
		<cl-export-btn />
	</cl-crud>
</template>
```

局部使用

```html
<template>
	<cl-crud>
		<cl-export-btn />
	</cl-crud>
</template>

<script>
	import { ExportBtn } from "cl-admin-export";

	export default {
		components: {
			"cl-export-btn": ExportBtn,
		},
	};
</script>
```

---
_Source: https://npm.io/package/cl-admin-export · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
