fix(脑图): 导航器修复
--bug=1047036 --user=白奇 【测试计划】首次进入计划详情页,需要双击导航器图标才能打开预览图弹窗 https://www.tapd.cn/55049933/s/1584885
This commit is contained in:
parent
f9336890e8
commit
b54e2d4660
|
@ -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<HTMLDivElement | null> = ref(null);
|
||||
|
||||
const isNavOpen = ref(false);
|
||||
const isNavOpen = ref(window.localStorage.getItem('navigator-hidden') || false);
|
||||
const previewNavigator: Ref<HTMLDivElement | null> = ref(null);
|
||||
const contentView = ref('');
|
||||
|
||||
|
@ -171,11 +171,6 @@
|
|||
let paper = reactive<any>({});
|
||||
let minder = reactive<any>({});
|
||||
|
||||
// 避免缓存
|
||||
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<string, any>, duration?: number) {
|
||||
if (!minder.getPaper || !visibleView.width || !visibleView.height) return;
|
||||
|
|
Loading…
Reference in New Issue