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', () => {
- + - + +
{{ displayText }}