Skip to content

Commit

Permalink
perf: optimize import file-saver way(PanJiaChen#2347)
Browse files Browse the repository at this point in the history
  • Loading branch information
reuwi authored and Trong. Pham Van - CMC Global DU1.19 committed Jul 22, 2022
1 parent 39e4f80 commit da21e2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/vendor/Export2Excel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
require('script-loader!file-saver');
import { saveAs } from 'file-saver'
import XLSX from 'xlsx'

function generateArray(table) {
Expand Down Expand Up @@ -151,14 +151,14 @@ export function export_json_to_excel({
filename,
merges = [],
autoWidth = true,
bookType= 'xlsx'
bookType = 'xlsx'
} = {}) {
/* original data */
filename = filename || 'excel-list'
data = [...data]
data.unshift(header);

for (let i = multiHeader.length-1; i > -1; i--) {
for (let i = multiHeader.length - 1; i > -1; i--) {
data.unshift(multiHeader[i])
}

Expand Down
2 changes: 1 addition & 1 deletion src/vendor/Export2Zip.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
require('script-loader!file-saver');
import { saveAs } from 'file-saver'
import JSZip from 'jszip'

export function export_txt_to_zip(th, jsonData, txtName, zipName) {
Expand Down

0 comments on commit da21e2f

Please sign in to comment.