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/useConfig.ts b/src/hooks/useConfig.ts index 5eceae3..8e20fc6 100644 --- a/src/hooks/useConfig.ts +++ b/src/hooks/useConfig.ts @@ -21,7 +21,7 @@ const defaultConfig: AppConfig = { size: defaultFontSizeConfig, }, other: { - editorPadding: '120px', + editorPadding: '0px', }, } 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..58e81fc 100644 --- a/src/renderer/components/StatusBar.vue +++ b/src/renderer/components/StatusBar.vue @@ -48,9 +48,9 @@ window.electronAPI.on('view:toggleView', () => {
- + - +
{{ displayText }} diff --git a/src/renderer/styles/milkdown.less b/src/renderer/styles/milkdown.less index 3b9dee2..eae2d67 100644 --- a/src/renderer/styles/milkdown.less +++ b/src/renderer/styles/milkdown.less @@ -1,50 +1,57 @@ .milkdown { height: 100%; background: var(--background-color-1); + padding: 0px var(--milkup-editor-padding); box-sizing: border-box; .editor { height: 100%; + } .ProseMirror { - padding: 60px var(--milkup-editor-padding); padding-bottom: 200px; } + p { - font-family: var(--milkup-font-default) !important; + font-family: var(--milkup-font-default) !important; font-size: var(--milkup-font-size-default) !important; } - h1 { - font-family: var(--milkup-font-default) !important; + h1 { + font-family: var(--milkup-font-default) !important; font-size: var(--milkup-font-size-h1) !important; } - h2 { - font-family: var(--milkup-font-default) !important; + + h2 { + font-family: var(--milkup-font-default) !important; font-size: var(--milkup-font-size-h2) !important; } - h3 { - font-family: var(--milkup-font-default) !important; + + h3 { + font-family: var(--milkup-font-default) !important; font-size: var(--milkup-font-size-h3) !important; } - h4 { - font-family: var(--milkup-font-default) !important; + + h4 { + font-family: var(--milkup-font-default) !important; font-size: var(--milkup-font-size-h4) !important; } - h5 { - font-family: var(--milkup-font-default) !important; + + h5 { + font-family: var(--milkup-font-default) !important; font-size: var(--milkup-font-size-h5) !important; } - h6 { - font-family: var(--milkup-font-default) !important; + + h6 { + font-family: var(--milkup-font-default) !important; font-size: var(--milkup-font-size-h6) !important; } @@ -63,42 +70,40 @@ .milkdown { @headers: h1, - h2, - h3, - h4, - h5, - h6; + h2, + h3, + h4, + h5, + h6; each(@headers, { - @{value} { - position: relative; - - &::before { - content: "@{value}"; // 输出 h1 、 h2 等 - position: absolute; - display: inline-flex; - align-items: center; - justify-content: center; - right:calc(100% + 2px); - top: 50%; - transform: translateY(-50%); - height: 14px; - color: var(--text-color-2); - padding: 2px 4px; - font-size: 10px; - border: 1px solid var(--border-color); - border-radius: 4px; - opacity: 0 - } - - &:hover::before { - opacity: 1; - transition: opacity 0.2s ease-in-out; - } + @{value} { + position: relative; + + &::before { + content: "@{value}"; // 输出 h1 、 h2 等 + position: absolute; + display: inline-flex; + align-items: center; + justify-content: center; + right:calc(100% + 2px); + top: 50%; + transform: translateY(-50%); + height: 14px; + color: var(--text-color-2); + padding: 2px 4px; + font-size: 10px; + border: 1px solid var(--border-color); + border-radius: 4px; + opacity: 0 } - } - ); + &:hover::before { + opacity: 1; + transition: opacity 0.2s ease-in-out; + } + } + }); } .ProseMirror-focused.ProseMirror .prosemirror-virtual-cursor {