From 4131865aee8a961106487e0dda8184390f652d4d Mon Sep 17 00:00:00 2001 From: he wei <858544502@qq.com> Date: 星期六, 09 十一月 2024 14:13:40 +0800 Subject: [PATCH] U bug修复 --- src/views/test/jhyRtInfo.vue | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/views/test/jhyRtInfo.vue b/src/views/test/jhyRtInfo.vue index 0dac298..a8067cc 100644 --- a/src/views/test/jhyRtInfo.vue +++ b/src/views/test/jhyRtInfo.vue @@ -1,5 +1,5 @@ <script setup> -import { ref, computed, watch, onMounted } from "vue"; +import { ref, computed, watch, onMounted, nextTick } from "vue"; import ycCard from "@/components/ycCard.vue"; import jhyInfo from "./jhyInfo.vue"; import useWebSocket from "@/hooks/useWebSocket.js"; @@ -126,12 +126,17 @@ changeTab(); }); -watch(() => props.onlyOneGroup, (val) => { - if (battVolChart.value) { - battVolChart.value[0].resize(); - battVolChart.value[1]?.resize(); +watch( + () => props.onlyOneGroup, + (val) => { + nextTick(() => { + if (battVolChart.value) { + battVolChart.value[0].resize(); + battVolChart.value[1]?.resize(); + } + }); } -}); +); function changeTab() { if (infoTab.value == 2) { @@ -163,7 +168,7 @@ onMounted(() => { // console.log('devId,' , props.devId, 'onMounted', '============='); - + let reg = /^2/; if (reg.test(props.devId)) { sendData(JSON.stringify({ devId: props.devId, devType: 2 })); -- Gitblit v1.9.1