diff --git a/packages/amis/src/renderers/Form/InputExcel.tsx b/packages/amis/src/renderers/Form/InputExcel.tsx index ac481f788..e119bb2b2 100644 --- a/packages/amis/src/renderers/Form/InputExcel.tsx +++ b/packages/amis/src/renderers/Form/InputExcel.tsx @@ -160,7 +160,8 @@ export default class ExcelControl extends React.PureComponent< processExcelFile(excelData: ArrayBuffer | string, fileName: string) { const {allSheets, onChange, parseImage, autoFill} = this.props; - import('exceljs').then(async (ExcelJS: any) => { + import('exceljs').then(async (E: any) => { + const ExcelJS = E.default || E; this.ExcelJS = ExcelJS; const workbook = new ExcelJS.Workbook(); await workbook.xlsx.load(excelData); diff --git a/packages/amis/src/renderers/Table/index.tsx b/packages/amis/src/renderers/Table/index.tsx index ec649c12f..8a749e363 100644 --- a/packages/amis/src/renderers/Table/index.tsx +++ b/packages/amis/src/renderers/Table/index.tsx @@ -2446,7 +2446,8 @@ export default class Table extends React.Component { loading: store.exportExcelLoading, onAction: () => { store.update({exportExcelLoading: true}); - import('exceljs').then(async (ExcelJS: any) => { + import('exceljs').then(async (E: any) => { + const ExcelJS = E.default || E; try { await exportExcel(ExcelJS, this.props, toolbar); } catch (error) { @@ -2480,7 +2481,8 @@ export default class Table extends React.Component { }, { onAction: () => { - import('exceljs').then(async (ExcelJS: any) => { + import('exceljs').then(async (E: any) => { + const ExcelJS = E.default || E; try { await exportExcel(ExcelJS, this.props, toolbar, true); } catch (error) {