mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-22 16:26:34 +08:00
fix: echarts resize error (#622)
This commit is contained in:
parent
cc84c85013
commit
03e959696e
|
@ -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<echarts.ECharts> => {
|
||||
export const useChart = (domId: string): ShallowRef<echarts.ECharts> => {
|
||||
let chartContainer: HTMLCanvasElement;
|
||||
const selfChart = ref<echarts.ECharts | any>();
|
||||
const selfChart = shallowRef<echarts.ECharts | any>();
|
||||
const updateContainer = () => {
|
||||
// TODO resize 报错,响应式的问题,待处理
|
||||
selfChart.value.resize({
|
||||
width: chartContainer.clientWidth,
|
||||
height: chartContainer.clientHeight,
|
||||
|
|
Loading…
Reference in New Issue
Block a user