File tree 3 files changed +47
-3
lines changed
3 files changed +47
-3
lines changed Original file line number Diff line number Diff line change 2
2
* @page:
3
3
* @Author: Orts
4
4
* @Date: 2021-12-09 13:54:32
5
- * @LastEditTime: 2021-12-09 18:07:24
5
+ * @LastEditTime: 2021-12-09 19:13:32
6
6
* @LastEditors: Orts
7
7
* @Description:
8
8
* @FilePath: /xlsx-in-vue3/README.md
@@ -39,3 +39,47 @@ vite+Vue3+element-plus+xlsx+x-data-spreadsheet
39
39
```
40
40
41
41
- 代码中有两种Object,一个是workbook是sheet对象,另一种是Spreadsheet是样式渲染对象。workbook实例要想被使用,需要转化成Spreadsheet需要的格式,不能直接使用,` excel.js ` 提供了stox方法,可以将workbook实例转化成Spreadsheet可加载的数据。
42
+ - 关于Spreadsheet的默认配置
43
+ ``` js
44
+ const options = {
45
+ mode: " edit" , // edit | read 编辑/只读
46
+ showToolbar: true ,
47
+ showGrid: true ,
48
+ showContextmenu: true ,
49
+ view: {
50
+ height : () => document .documentElement .clientHeight ,
51
+ width : () => document .documentElement .clientWidth ,
52
+ },
53
+ row: {
54
+ len: 100 ,
55
+ height: 25 ,
56
+ },
57
+ col: {
58
+ len: 26 ,
59
+ width: 100 ,
60
+ indexWidth: 60 ,
61
+ minWidth: 60 ,
62
+ },
63
+ style: {
64
+ bgcolor: " #ffffff" ,
65
+ align: " left" ,
66
+ valign: " middle" ,
67
+ textwrap: false ,
68
+ strike: false ,
69
+ underline: false ,
70
+ color: " #0a0a0a" ,
71
+ font: {
72
+ name: " Helvetica" ,
73
+ size: 10 ,
74
+ bold: false ,
75
+ italic: false ,
76
+ },
77
+ },
78
+ };
79
+ ```
80
+ - Spreadsheet的文档没有更新,本地化需要这样设置:
81
+ ``` js
82
+ import Spreadsheet from " x-data-spreadsheet" ;
83
+ import " x-data-spreadsheet/dist/locale/zh-cn" ;
84
+ Spreadsheet .locale (" zh-cn" , window .x_spreadsheet .$messages [" zh-cn" ]);
85
+ ```
Original file line number Diff line number Diff line change 5
5
< link rel ="icon " href ="./favicon.ico " />
6
6
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
7
< title > Vite App</ title >
8
- < script type ="module " crossorigin src ="./assets/index.d954de64 .js "> </ script >
8
+ < script type ="module " crossorigin src ="./assets/index.ac6f5598 .js "> </ script >
9
9
< link rel ="modulepreload " href ="./assets/lodash.5b4087a0.js ">
10
10
< link rel ="modulepreload " href ="./assets/elementPlus.ff50657a.js ">
11
11
< link rel ="modulepreload " href ="./assets/xlsx.9c787818.js ">
You can’t perform that action at this time.
0 commit comments