iloveuav opened a new issue #14218:
URL: https://github.com/apache/echarts/issues/14218


   ### Version
   5.0.1
   
   ### Steps to reproduce
   import echarts from 'echarts/lib/echarts';
   import { ThemeType, ChartType } from '@utils/Enum';
   import { IBaseChartConfig } from '@iwtypes/IBaseChartConfig';
   import blueTheme from './blue';
   import greenTheme from './green';
   import darkTheme from './dark';
   
   import greenEChartTheme from './green/green.json';
   import blueEChartTheme from './blue/blue.json';
   import darkEChartTheme from './dark/dark.json';
   
   // 注册echarts主题
   echarts.registerTheme(`${ThemeType.GREEN}theme`, greenEChartTheme);
   echarts.registerTheme(`${ThemeType.BLUE}theme`, blueEChartTheme);
   echarts.registerTheme(`${ThemeType.DARK}theme`, darkEChartTheme);
   
   export function getChartThemeConfig(
     chart: ChartType,
     theme?: ThemeType
   ): IBaseChartConfig {
     if (theme === ThemeType.BLUE) {
       return blueTheme[chart];
     } else if (theme === ThemeType.DARK) {
       return darkTheme[chart];
     } else {
       return greenTheme[chart];
     }
   }
   
   -----------------------------------
   
   ©>Uncaught TypeError:index.ts?6a07:13echarts lib echarts WEBPACK IMPORTED 
MODULE 0 .default.registerTheme is not a function
   
   ### What is expected?
   Subject normal registration
   
   ### What is actually happening?
   Failed to register the subject
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to