mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge pull request #10209 from nwind/chore-import-default
chore: 兼容 exceljs 在部分打包配置下引入错误问题 Closes #9598
This commit is contained in:
commit
e6385a86c4
@ -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);
|
||||
|
@ -2446,7 +2446,8 @@ export default class Table extends React.Component<TableProps, object> {
|
||||
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<TableProps, object> {
|
||||
},
|
||||
{
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user