diff --git a/zhandianxinxi/光谱数据监控/src/App.vue b/zhandianxinxi/光谱数据监控/src/App.vue index ce9ad40..382befe 100644 --- a/zhandianxinxi/光谱数据监控/src/App.vue +++ b/zhandianxinxi/光谱数据监控/src/App.vue @@ -129,7 +129,7 @@ - + @@ -270,10 +270,21 @@ const hideSelected = () => { ElMessage.info('选中的设备已在屏蔽列表中') } } - +const siderold = ref(null) +var tempdata=0 const showDetails = (row) => { activeDevice.value = row drawerVisible.value = true + nextTick(() => { + // 此时 siderold.value 才有值 + // 使用 ?. 防止极个别情况下组件未挂载导致的报错 + if (siderold.value) { + siderold.value.loaddata(row) + tempdata++; + } else { + console.warn("子组件尚未挂载") + } + }) } // --- 过滤与排序 --- diff --git a/zhandianxinxi/光谱数据监控/src/sidevueold.vue b/zhandianxinxi/光谱数据监控/src/sidevueold.vue index 0024ee1..ecffbf9 100644 --- a/zhandianxinxi/光谱数据监控/src/sidevueold.vue +++ b/zhandianxinxi/光谱数据监控/src/sidevueold.vue @@ -1,20 +1,36 @@