@@ -14,7 +14,8 @@ import {
14
14
nextTick ,
15
15
PropType ,
16
16
watchEffect ,
17
- Vue2
17
+ Vue2 ,
18
+ InjectionKey
18
19
} from "vue-demi" ;
19
20
import { init as initChart } from "echarts/core" ;
20
21
import {
@@ -44,9 +45,9 @@ if (Vue2) {
44
45
Vue2 . config . ignoredElements . push ( TAG_NAME ) ;
45
46
}
46
47
47
- export const THEME_KEY = "ecTheme" ;
48
- export const INIT_OPTIONS_KEY = "ecInitOptions" ;
49
- export const UPDATE_OPTIONS_KEY = "ecUpdateOptions" ;
48
+ export const THEME_KEY = "ecTheme" as unknown as InjectionKey < ThemeInjection > ;
49
+ export const INIT_OPTIONS_KEY = "ecInitOptions" as unknown as InjectionKey < InitOptionsInjection > ;
50
+ export const UPDATE_OPTIONS_KEY = "ecUpdateOptions" as unknown as InjectionKey < UpdateOptionsInjection > ;
50
51
export { LOADING_OPTIONS_KEY } from "./composables" ;
51
52
52
53
export default defineComponent ( {
@@ -69,15 +70,15 @@ export default defineComponent({
69
70
const root = shallowRef < HTMLElement > ( ) ;
70
71
const chart = shallowRef < EChartsType > ( ) ;
71
72
const manualOption = shallowRef < Option > ( ) ;
72
- const defaultTheme = inject ( THEME_KEY , null ) as ThemeInjection ;
73
+ const defaultTheme = inject ( THEME_KEY , null ) ;
73
74
const defaultInitOptions = inject (
74
75
INIT_OPTIONS_KEY ,
75
76
null
76
- ) as InitOptionsInjection ;
77
+ ) ;
77
78
const defaultUpdateOptions = inject (
78
79
UPDATE_OPTIONS_KEY ,
79
80
null
80
- ) as UpdateOptionsInjection ;
81
+ ) ;
81
82
82
83
const { autoresize, manualUpdate, loading, loadingOptions } = toRefs ( props ) ;
83
84
0 commit comments