feat: 渲染全线设备树时自动定位到所选设备

This commit is contained in:
yangsy
2025-12-18 20:49:15 +08:00
parent d565fd6a5f
commit fee9c5ef6c

View File

@@ -460,6 +460,14 @@ const onLocateDeviceTree = async () => {
animated.value = true;
};
// 渲染全线设备树时,若是首次选择设备,则定位设备树
const unwatch = watch(selectedDevice, async (newDevice, oldDevice) => {
if (!!station.value) return;
if (!!newDevice && !oldDevice && !!deviceTreeInst.value) {
await onLocateDeviceTree();
unwatch();
}
});
</script>
<template>