Files
mes-ui-d2/static/markdownFiles/article/插件 - 导出数据.md
李杨 2066b77358 no message
Former-commit-id: 001a03313c662d8798dc0253523ff3173f8a1c1f
Former-commit-id: 5c27db6f49704f3ae850c24aaf96f85bbf172f9b
Former-commit-id: c04352cc6333b087e3999b4dada865799ba766c5
2018-02-10 22:51:36 +08:00

48 lines
615 B
Markdown

# 导出数据
## 使用
### 注册插件
```
import pluginExport from '@/plugin/export'
Vue.use(pluginExport)
```
### 导出 `CSV`
使用方法
```
const columns = [
{
label: '姓名',
prop: 'name'
},
{
label: '年龄',
prop: 'age'
}
]
const data = [
{
name: 'lucy',
age: 24
},
{
name: 'bob',
age: 26
}
]
this.$export.csv({
columns,
data
})
```
参数
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
| --- | --- | --- | --- | --- | --- |
| columns | 列 | 非 | Array | | 空数组 |
| data | 行数据 | 非 | Array | | 空数组 |