docs: fix typo in sample code

This commit is contained in:
Justineo
2021-02-23 18:51:43 +08:00
parent 39437ba907
commit c1bf3695cc
4 changed files with 7 additions and 4 deletions

View File

@ -37,7 +37,7 @@ import {
} from 'echarts/renderers' } from 'echarts/renderers'
import { import {
BarChart BarChart
} from 'echarts/chart' } from 'echarts/charts'
import { import {
GridComponent, GridComponent,
TooltipComponent TooltipComponent

View File

@ -35,7 +35,7 @@ import {
} from 'echarts/renderers' } from 'echarts/renderers'
import { import {
BarChart BarChart
} from 'echarts/chart' } from 'echarts/charts'
import { import {
GridComponent, GridComponent,
TooltipComponent TooltipComponent

View File

@ -4,6 +4,7 @@ import {
ref, ref,
unref, unref,
shallowRef, shallowRef,
toRef,
toRefs, toRefs,
watch, watch,
computed, computed,
@ -77,7 +78,9 @@ export default defineComponent({
() => props.updateOptions || unref(defaultUpdateOptions) || {} () => 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) { function init(option?: Option) {
if (chart.value || !root.value) { if (chart.value || !root.value) {

View File

@ -6,7 +6,7 @@ export const LOADING_OPTIONS_KEY = "ecLoadingOptions";
export function useLoading( export function useLoading(
chart: Ref<EChartsType | undefined>, chart: Ref<EChartsType | undefined>,
loading: Ref<boolean>, loading: Ref<boolean>,
loadingOptions?: Ref<object | undefined> loadingOptions: Ref<object | undefined>
): void { ): void {
const defaultLoadingOptions = inject(LOADING_OPTIONS_KEY, {}) as const defaultLoadingOptions = inject(LOADING_OPTIONS_KEY, {}) as
| object | object