diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index f68822d..abd3601 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -7,21 +7,28 @@ import guadmap from './map/index.vue' import useWebsocketStore from '@/store/modules/websocket' const websocket = useWebsocketStore() +// 页面高度 const mainHeight = ref(document.body.clientHeight - 50) +// 高度随页面resize变化 window.addEventListener('resize', () => { const bodyHeight = document.body.clientHeight - 50 mainHeight.value = bodyHeight }) +const loading = ref(true) +const offLoading = () => { + loading.value = false +} onMounted(() => { + loading.value = true // 连接websocket // websocket.initWebSocket() }) diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index f68822d..abd3601 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -7,21 +7,28 @@ import guadmap from './map/index.vue' import useWebsocketStore from '@/store/modules/websocket' const websocket = useWebsocketStore() +// 页面高度 const mainHeight = ref(document.body.clientHeight - 50) +// 高度随页面resize变化 window.addEventListener('resize', () => { const bodyHeight = document.body.clientHeight - 50 mainHeight.value = bodyHeight }) +const loading = ref(true) +const offLoading = () => { + loading.value = false +} onMounted(() => { + loading.value = true // 连接websocket // websocket.initWebSocket() }) diff --git a/src/views/dashboard/map/index.vue b/src/views/dashboard/map/index.vue index 1fa370b..76b90ed 100644 --- a/src/views/dashboard/map/index.vue +++ b/src/views/dashboard/map/index.vue @@ -5,6 +5,7 @@ -->