mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-11-07 05:28:06 +08:00
feat: make it possible to dynamically change provide values for Vue 2
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
import { unwrapInjected } from "src/utils";
|
||||
import {
|
||||
inject,
|
||||
unref,
|
||||
computed,
|
||||
Ref,
|
||||
watchEffect,
|
||||
InjectionKey
|
||||
type Ref,
|
||||
type InjectionKey
|
||||
} from "vue-demi";
|
||||
import { EChartsType } from "../types";
|
||||
|
||||
@ -22,7 +23,7 @@ export function useLoading(
|
||||
): void {
|
||||
const defaultLoadingOptions = inject(LOADING_OPTIONS_KEY, {});
|
||||
const realLoadingOptions = computed(() => ({
|
||||
...unref(defaultLoadingOptions),
|
||||
...unwrapInjected(defaultLoadingOptions, {}),
|
||||
...loadingOptions?.value
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user