vxe-table-plugin-export-xlsx-xhx 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +46 -49
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,76 +1,73 @@
|
|
1
|
-
# vxe-table-plugin-export-xlsx
|
2
1
|
|
3
|
-
|
4
|
-
[![npm version](https://img.shields.io/npm/v/vxe-table-plugin-export-xlsx.svg?style=flat-square)](https://www.npmjs.org/package/vxe-table-plugin-export-xlsx)
|
5
|
-
[![npm downloads](https://img.shields.io/npm/dm/vxe-table-plugin-export-xlsx.svg?style=flat-square)](http://npm-stat.com/charts.html?package=vxe-table-plugin-export-xlsx)
|
6
|
-
[![gzip size: JS](http://img.badgesize.io/https://unpkg.com/vxe-table-plugin-export-xlsx/dist/index.min.js?compression=gzip&label=gzip%20size:%20JS)](https://unpkg.com/vxe-table-plugin-export-xlsx/dist/index.min.js)
|
7
|
-
[![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/xuliangzhan/vxe-table-plugin-export-xlsx/blob/master/LICENSE)
|
2
|
+
# vxe-table-plugin-export-xlsx-xhx
|
8
3
|
|
9
4
|
基于 [vxe-table](https://github.com/xuliangzhan/vxe-table) 表格的增强插件,支持导出 xlsx 格式
|
10
5
|
|
11
|
-
##
|
6
|
+
## introductions
|
7
|
+
|
8
|
+
基于 vxe-table-plugin-export-xlsx 1.3.4版本进行工程适应性修改
|
9
|
+
注意: 隶属于旧项目使用, 新工程请参照 vxe-table-plugin-export-xlsx
|
10
|
+
|
11
|
+
## history
|
12
|
+
|
13
|
+
版本 1.0.9 对IE11进行适配
|
14
|
+
版本 1.0.2 不进行多余导出
|
12
15
|
|
16
|
+
## Installing
|
13
17
|
```shell
|
14
|
-
npm install xe-utils vxe-table vxe-table-plugin-export-xlsx xlsx
|
18
|
+
npm install xe-utils vxe-table vxe-table-plugin-export-xlsx-xhx xlsx
|
15
19
|
```
|
16
|
-
|
17
20
|
```javascript
|
18
21
|
import Vue from 'vue'
|
19
22
|
import VXETable from 'vxe-table'
|
20
|
-
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
|
23
|
+
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx-xhx'
|
21
24
|
import 'vxe-table/lib/index.css'
|
22
|
-
|
23
25
|
Vue.use(VXETable)
|
24
26
|
VXETable.use(VXETablePluginExportXLSX)
|
25
27
|
```
|
26
|
-
|
27
28
|
## Demo
|
28
|
-
|
29
29
|
```html
|
30
30
|
<vxe-toolbar>
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
<template v-slot:buttons>
|
32
|
+
<vxe-button @click="exportEvent">导出.xlsx</vxe-button>
|
33
|
+
</template>
|
34
34
|
</vxe-toolbar>
|
35
|
-
|
36
35
|
<vxe-table
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
border
|
37
|
+
ref="xTable"
|
38
|
+
height="600"
|
39
|
+
:data="tableData">
|
40
|
+
<vxe-table-column type="index" width="60"></vxe-table-column>
|
41
|
+
<vxe-table-column field="name" title="Name"></vxe-table-column>
|
42
|
+
<vxe-table-column field="age" title="Age"></vxe-table-column>
|
43
|
+
<vxe-table-column field="date" title="Date"></vxe-table-column>
|
45
44
|
</vxe-table>
|
46
45
|
```
|
47
|
-
|
48
46
|
```javascript
|
49
47
|
export default {
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
48
|
+
data () {
|
49
|
+
return {
|
50
|
+
tableData: [
|
51
|
+
{
|
52
|
+
id: 100,
|
53
|
+
name: 'test',
|
54
|
+
age: 26,
|
55
|
+
date: null
|
56
|
+
}
|
57
|
+
]
|
58
|
+
}
|
59
|
+
},
|
60
|
+
methods: {
|
61
|
+
exportEvent() {
|
62
|
+
this.$refs.xTable.exportData({
|
63
|
+
filename: 'export',
|
64
|
+
sheetName: 'Sheet1',
|
65
|
+
type: 'xlsx'
|
66
|
+
})
|
67
|
+
}
|
68
|
+
}
|
71
69
|
}
|
72
70
|
```
|
73
|
-
|
74
71
|
## License
|
75
|
-
|
76
72
|
MIT License, 2019-present, Xu Liangzhan
|
73
|
+
|