Skip to content

Commit f3d7f05

Browse files
committedNov 25, 2020
fix: 由于会引起问题,暂时取消列宽设置
1 parent 61637cd commit f3d7f05

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed
 

Diff for: ‎src/_export2Excel.js

-4
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,6 @@ export function export_json_to_excel(th, jsonData, defaultTitle, options = { mer
141141
merges = merges.map(i => i instanceof Array ? { s: i[0], e: i[1] } : i); // be sort :) # ['A1', 'C1'] => { s: 'A1', e: 'C3' }
142142
ws['!merges'] = merges;
143143

144-
if(options.cols){
145-
ws["!cols"] = options.cols;
146-
}
147-
148144
/* add worksheet to workbook */
149145
wb.SheetNames.push(ws_name);
150146
wb.Sheets[ws_name] = ws;

Diff for: ‎src/index.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,15 @@ const vueTableExport = {
3535
columns: [],
3636
data: [],
3737
title: 'table',
38-
header: null,
39-
merges: [],
38+
header: null
4039
}
4140
// 合并参数
4241
const _params = Object.assign({}, paramsDefault, params)
4342
// 从参数中派生数据
4443
const header = _params.columns.map(e => e.label)
4544
const data = _params.data.map(row => _params.columns.map(col => row[col.prop]))
46-
47-
const cols = _params.columns.map(e => {
48-
let col = {...e}
49-
delete col.label;
50-
delete col.prop;
51-
return col
52-
})
5345
// 导出
54-
Excel.export_json_to_excel(header, data, _params.title, { merges: _params.merges, header: _params.header,cols: cols })
46+
Excel.export_json_to_excel(header, data, _params.title, { merges: _params.merges, header: _params.header })
5547
// 完成
5648
resolve()
5749
})

0 commit comments

Comments
 (0)
Please sign in to comment.