This commit is contained in:
xiaozhiyong
2026-06-16 11:49:02 +08:00
parent 82c1cce942
commit 9fdfb2f74b
3 changed files with 62 additions and 7 deletions

View File

@@ -23,22 +23,31 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, onMounted, watch } from 'vue'
import DeviceInfo from './components/info/index.vue'
import DeviceLine from './components/line/index.vue'
import DeviceTrend from './components/trend/index.vue'
import DeviceConfig from './components/config/index.vue'
defineProps({
const props = defineProps({
device: {
type: Object,
default: () => null
}
})
const activeMenu = ref('info')
const activeMenu = ref('')
const emit = defineEmits(['back'])
watch(
() => props.device?.gatewayMac,
(newMac, oldMac) => {
if (newMac && newMac !== oldMac) {
activeMenu.value = 'info'
}
}
)
const handleBack = () => {
activeMenu.value = ''
emit('back')