diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 3c26653..cd5a8d0 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,16 +1,14 @@ import * as echarts from 'echarts/core'; -import { onMounted, onUnmounted, Ref, ref } from 'vue'; +import { onMounted, onUnmounted, Ref, ref, ShallowRef, shallowRef } from 'vue'; /** * eChart hook * @param domId - * @param chart */ -export const useChart = (domId: string): Ref => { +export const useChart = (domId: string): ShallowRef => { let chartContainer: HTMLCanvasElement; - const selfChart = ref(); + const selfChart = shallowRef(); const updateContainer = () => { - // TODO resize 报错,响应式的问题,待处理 selfChart.value.resize({ width: chartContainer.clientWidth, height: chartContainer.clientHeight,