From c8c4111a6b41956ccf5ed0e0921721c49e0ad5ce Mon Sep 17 00:00:00 2001 From: XiaoZuoOvO <2826618614@qq.com> Date: Tue, 11 Nov 2025 17:52:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95=E6=97=B6=E6=BA=90?= =?UTF-8?q?=E7=A0=81=E6=A8=A1=E5=BC=8F=E5=BE=97tab=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=A4=8D=E4=BD=8D=E5=BE=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/index.js | 4 ++-- src/hooks/useOutline.ts | 5 +++-- src/renderer/components/StatusBar.vue | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lang/index.js b/lang/index.js index 1403582..b7c7383 100644 --- a/lang/index.js +++ b/lang/index.js @@ -1,5 +1,5 @@ - // 导入国际化JSON文件(合并模式) + // 导入国际化JSON文件 import langJSON from './index.json' (function () { // 定义翻译函数 @@ -43,7 +43,7 @@ globalThis.$t = globalThis.$t || $t; // 将简单翻译函数挂载到globalThis对象上 globalThis.$$t = $$t; - // 定义从JSON文件中获取指定键的语言对象的方法(合并模式) + // 定义从JSON文件中获取指定键的语言对象的方法 globalThis._getJSONKey = function (key, insertJSONObj = undefined) { // 获取JSON对象 const JSONObj = insertJSONObj; diff --git a/src/hooks/useOutline.ts b/src/hooks/useOutline.ts index d3529e5..6b60bbe 100644 --- a/src/hooks/useOutline.ts +++ b/src/hooks/useOutline.ts @@ -2,8 +2,9 @@ import { onMounted, onUnmounted, ref } from 'vue' import emitter from '@/renderer/events' const isShowOutline = ref(false) -function toggleShowOutline() { - isShowOutline.value = !isShowOutline.value +function toggleShowOutline(status?: boolean | null) { + const toggle = status !== null && status !== undefined + isShowOutline.value = toggle ? status : !isShowOutline.value } export default function useOutline() { const outline = ref<{ id: string, level: number, text: string }[]>([] as any) diff --git a/src/renderer/components/StatusBar.vue b/src/renderer/components/StatusBar.vue index a7b48a3..e341cd7 100644 --- a/src/renderer/components/StatusBar.vue +++ b/src/renderer/components/StatusBar.vue @@ -48,9 +48,10 @@ window.electronAPI.on('view:toggleView', () => {