更新
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user