@vxe-ui/plugin-menu 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Xu Liangzhan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # @vxe-ui/plugin-export-pdf
2
+
3
+ [Vxe UI](https://vxeui.com/) plug-in supports pdf file export. use [jspdf](https://github.com/MrRio/jsPDF).
4
+
5
+ ## Compatibility
6
+
7
+ It corresponds to [vxe-table v4](https://www.npmjs.com/package/vxe-table) or [vxe-pc-ui v4](https://www.npmjs.com/package/vxe-pc-ui)
8
+
9
+ ## Installing
10
+
11
+ ```shell
12
+ npm install @vxe-ui/plugin-export-pdf jspdf
13
+ ```
14
+
15
+ ```javascript
16
+ // ...
17
+ // Use vxe-pc-ui
18
+ import { VxeUI } from 'vxe-pc-ui'
19
+ // Use vxe-table
20
+ // import { VxeUI } from 'vxe-table'
21
+ import VxeUIPluginExportPDF from '@vxe-ui/plugin-export-pdf'
22
+ import { jsPDF } from 'jspdf'
23
+ // ...
24
+
25
+ // 1:NPM install, inject jsPDF objects
26
+ VxeUI.use(VxeUIPluginExportPDF, {
27
+ jsPDF,
28
+ // 支持中文字体
29
+ // fontName: 'SourceHanSans-Normal',
30
+ // fonts: [
31
+ // {
32
+ // fontName: 'SourceHanSans-Normal',
33
+ // fontUrl: 'https://cdn.jsdelivr.net/npm/vxe-table-plugin-export-pdf/fonts/source-han-sans-normal.js'
34
+ // }
35
+ // ]
36
+ })
37
+
38
+ // 2:CDN install, just make sure window.jsPDF exists
39
+ // VxeUI.use(VxeUIPluginExportPDF)
40
+ ```
41
+
42
+ ## Demo
43
+
44
+ ```html
45
+ <vxe-button @click="exportEvent">Export.pdf</vxe-button>
46
+
47
+ <vxe-table
48
+ ref="tableRef"
49
+ :height="600"
50
+ :data="tableData">
51
+ <vxe-column type="seq" width="60"></vxe-column>
52
+ <vxe-column field="name" title="Name"></vxe-column>
53
+ <vxe-column field="age" title="Age"></vxe-column>
54
+ <vxe-column field="date" title="Date"></vxe-column>
55
+ </vxe-table>
56
+ ```
57
+
58
+ ```javascript
59
+ export default {
60
+ data () {
61
+ return {
62
+ tableData: [
63
+ { id: 100, name: 'test', age: 26, date: '2019-01-01' },
64
+ { id: 101, name: 'test1', age: 30, date: '2019-01-01' },
65
+ { id: 102, name: 'test2', age: 34, date: '2019-01-01' }
66
+ ]
67
+ }
68
+ },
69
+ methods: {
70
+ exportEvent() {
71
+ this.$refs.tableRef.exportData({
72
+ filename: 'export',
73
+ sheetName: 'Sheet1',
74
+ type: 'pdf'
75
+ })
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## Contributors
82
+
83
+ Thank you to everyone who contributed to this project.
84
+
85
+ [![vxe-ui-plugins](https://contrib.rocks/image?repo=x-extends/vxe-ui-plugins)](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
86
+
87
+ ## License
88
+
89
+ [MIT](LICENSE) © 2019-present, Xu Liangzhan