From b54e2d466073201e69bad552c97cca2cdb76ee07 Mon Sep 17 00:00:00 2001 From: baiqi Date: Tue, 24 Sep 2024 15:38:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=91=E5=9B=BE):=20=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1047036 --user=白奇 【测试计划】首次进入计划详情页,需要双击导航器图标才能打开预览图弹窗 https://www.tapd.cn/55049933/s/1584885 --- .../pure/ms-minder-editor/main/navigator.vue | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/pure/ms-minder-editor/main/navigator.vue b/frontend/src/components/pure/ms-minder-editor/main/navigator.vue index 701cc26fe5..eec153dd74 100644 --- a/frontend/src/components/pure/ms-minder-editor/main/navigator.vue +++ b/frontend/src/components/pure/ms-minder-editor/main/navigator.vue @@ -151,7 +151,7 @@ import { useI18n } from '@/hooks/useI18n'; import { navigatorProps } from '../props'; - import { getLocalStorage, setLocalStorage } from '../script/store'; + import { setLocalStorage } from '../script/store'; import type { Ref } from 'vue'; const props = defineProps(navigatorProps); @@ -160,7 +160,7 @@ const navPreviewer: Ref = ref(null); - const isNavOpen = ref(false); + const isNavOpen = ref(window.localStorage.getItem('navigator-hidden') || false); const previewNavigator: Ref = ref(null); const contentView = ref(''); @@ -171,11 +171,6 @@ let paper = reactive({}); let minder = reactive({}); - // 避免缓存 - function getNavOpenState() { - return getLocalStorage('navigator-hidden'); - } - const zoomPercent = ref(50); // 默认 100%缩放(滑动条是从 50% 开始,所以减 50) /** * 缩放 @@ -291,13 +286,11 @@ } function toggleNavOpen() { - let isNavOpenState = false; - isNavOpenState = !JSON.parse(getNavOpenState()); - isNavOpen.value = isNavOpenState; + isNavOpen.value = !isNavOpen.value; setLocalStorage('navigator-hidden', isNavOpen.value); nextTick(() => { - if (isNavOpenState) { + if (isNavOpen.value) { bind(); updateContentView(); updateVisibleView(); @@ -306,6 +299,7 @@ } }); } + function navigate() { function moveView(center: Record, duration?: number) { if (!minder.getPaper || !visibleView.width || !visibleView.height) return;