Skip to content

Commit

Permalink
fix: 🐛 修复导出的数据重复为最后一列
Browse files Browse the repository at this point in the history
Closes: #14
  • Loading branch information
xiongjie.xue committed Aug 31, 2021
1 parent b11816e commit d67b15a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.DS_Store
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-json2excel",
"version": "3.1.1",
"version": "3.1.2",
"description": "✌传入json,可自定义表格标题名称和列数、头部名称、过滤列和绑定生成开始与成功的回调函数",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default class Json2Excel {
}

toChsKeys (json: any[], keyMap: any) {
let newItem: { [x: string]: object; } = {}
return json.map(item => {
let newItem: { [x: string]: object; } = {};

if (this.orderedKey.length) {
// 指定key顺序,适用于需要key按照一定顺序,并且只保留key中存在的字段
Expand Down

0 comments on commit d67b15a

Please sign in to comment.