From 086be4da6619e9f8c4e1992544ab99617ae98148 Mon Sep 17 00:00:00 2001 From: "DESKTOP-FUDKNA8\\znjsz" Date: Fri, 26 Jan 2024 16:38:23 +0800 Subject: [PATCH] fix lunbo --- src/MainPage.vue | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/MainPage.vue b/src/MainPage.vue index 2b61bae..c7c68f7 100644 --- a/src/MainPage.vue +++ b/src/MainPage.vue @@ -13,7 +13,7 @@ import { useSettings } from "./store/settings"; const props = defineProps(["path"]); -const pages = ['3d', 'data', 'realtime', 'alert'] +const pages = ['3d', 'data', 'realtime', 'alert', 'announcement'] const currentPage = ref("3d"); const handlePageChange = (page) => { currentPage.value = page; @@ -44,19 +44,19 @@ store.$subscribe((mutation, state) => { }) -// // 检查状态 -// onMounted(() => { -// const settings = store.settings; -// if (settings.carousel) { -// // 开始轮播 -// if (timer.value) clearInterval(timer.value); -// timer.value = setInterval(() => { -// handlePageChange(pages[(pages.indexOf(currentPage.value) + 1) % pages.length]) -// }, settings.carouselTime * 1000); -// } -// // 设置分辨率 -// handleResolutionChange(settings.resolution.width, settings.resolution.height); -// }) +// 检查状态 +onMounted(() => { + const settings = store.settings; + if (settings.carousel) { + // 开始轮播 + if (timer.value) clearInterval(timer.value); + timer.value = setInterval(() => { + handlePageChange(pages[(pages.indexOf(currentPage.value) + 1) % pages.length]) + }, settings.carouselTime * 1000); + } + // 设置分辨率 + handleResolutionChange(settings.resolution.width, settings.resolution.height); +}) const pathMap = {