fix: 调整echarts-stat使用方式,兼容vite打包异步非esm模块 (#5672)

This commit is contained in:
刘丹 2022-11-02 11:42:53 +08:00 committed by GitHub
parent 2bdb5c6a97
commit c1b1228f16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -308,7 +308,7 @@ export class Chart extends React.Component<ChartProps> {
import('echarts/extension/bmap/bmap') import('echarts/extension/bmap/bmap')
]).then(async ([echarts, ecStat]) => { ]).then(async ([echarts, ecStat]) => {
(window as any).echarts = echarts; (window as any).echarts = echarts;
(window as any).ecStat = ecStat; (window as any).ecStat = ecStat?.default || ecStat;
let theme = 'default'; let theme = 'default';
if (chartTheme) { if (chartTheme) {