fix: 解决首页 echarts 不能自适应的问题

This commit is contained in:
zhengkunwang223 2023-02-22 17:30:46 +08:00 committed by zhengkunwang223
parent 6639192c9a
commit 2ba24dadfb
2 changed files with 6 additions and 16 deletions

View file

@ -40,20 +40,6 @@ defineProps({
border-radius: 10px;
}
}
// span:first-child {
// background: $primary-color;
// border-radius: 7px;
// flex: none;
// order: 0;
// flex-grow: 0;
// padding: 3px;
// }
// span:nth-child(2) {
// font-size: 18px;
// font-weight: 700;
// margin-left: 10px;
// }
}
div:nth-child(2) {

View file

@ -583,8 +583,12 @@ function freshChart(chartName: string, legendDatas: any, xDatas: any, yDatas: an
}
function changeChartSize() {
echarts.getInstanceByDom(document.getElementById('ioChart') as HTMLElement)?.resize();
echarts.getInstanceByDom(document.getElementById('networkChart') as HTMLElement)?.resize();
if (document.getElementById('ioChart') != null) {
echarts.getInstanceByDom(document.getElementById('ioChart') as HTMLElement)?.resize();
}
if (document.getElementById('networkChart') != null) {
echarts.getInstanceByDom(document.getElementById('networkChart') as HTMLElement)?.resize();
}
}
onMounted(() => {