From c1bf3695cc1899de39a515666d2037ae38ac9e8d Mon Sep 17 00:00:00 2001 From: Justineo Date: Tue, 23 Feb 2021 18:51:43 +0800 Subject: [PATCH] docs: fix typo in sample code --- README.md | 2 +- README.zh-Hans.md | 2 +- src/ECharts.ts | 5 ++++- src/composables/loading.ts | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 53dab8c..4f10a99 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ import { } from 'echarts/renderers' import { BarChart -} from 'echarts/chart' +} from 'echarts/charts' import { GridComponent, TooltipComponent diff --git a/README.zh-Hans.md b/README.zh-Hans.md index dd0bb09..5bdf575 100644 --- a/README.zh-Hans.md +++ b/README.zh-Hans.md @@ -35,7 +35,7 @@ import { } from 'echarts/renderers' import { BarChart -} from 'echarts/chart' +} from 'echarts/charts' import { GridComponent, TooltipComponent diff --git a/src/ECharts.ts b/src/ECharts.ts index 6292953..10c388e 100644 --- a/src/ECharts.ts +++ b/src/ECharts.ts @@ -4,6 +4,7 @@ import { ref, unref, shallowRef, + toRef, toRefs, watch, computed, @@ -77,7 +78,9 @@ export default defineComponent({ () => props.updateOptions || unref(defaultUpdateOptions) || {} ); - const { autoresize, manualUpdate, loading, loadingOptions } = toRefs(props); + const { autoresize, manualUpdate, loading } = toRefs(props); + const loadingOptions = toRef(props, "loadingOptions"); + const a = toRef(props, "autoresize"); function init(option?: Option) { if (chart.value || !root.value) { diff --git a/src/composables/loading.ts b/src/composables/loading.ts index aad5500..ad36f36 100644 --- a/src/composables/loading.ts +++ b/src/composables/loading.ts @@ -6,7 +6,7 @@ export const LOADING_OPTIONS_KEY = "ecLoadingOptions"; export function useLoading( chart: Ref, loading: Ref, - loadingOptions?: Ref + loadingOptions: Ref ): void { const defaultLoadingOptions = inject(LOADING_OPTIONS_KEY, {}) as | object