Skip to content

Commit c4d6286

Browse files
committed
fix: 修复默认打开侧边栏时内容区域文本超出的问题
1 parent 5cac571 commit c4d6286

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/renderer/App.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ import { onMounted, onUnmounted, ref, watch, nextTick, computed } from "vue";
109109
// 大纲侧边栏两阶段动画状态机
110110
// closed: 隐藏 | opening: transform 滑入动画 | open: flex 正常布局 | closing-prep: 切回 transform 定位 | closing: transform 滑出动画
111111
type OutlineState = "closed" | "opening" | "open" | "closing-prep" | "closing";
112-
const outlineState = ref<OutlineState>(isShowOutline.value ? "open" : "closed");
112+
const initialOutlineVisible = Boolean(config.value.workspace?.autoExpandSidebar);
113+
toggleShowOutline(initialOutlineVisible);
114+
const outlineState = ref<OutlineState>(initialOutlineVisible ? "open" : "closed");
113115
const editorAreaRef = ref<HTMLElement | null>(null);
114116
115117
const outlineClass = computed(() => `outline-${outlineState.value}`);
@@ -140,7 +142,6 @@ onMounted(() => {
140142
initFont();
141143
initOtherConfig();
142144
initSpellCheck();
143-
toggleShowOutline(Boolean(config.value.workspace?.autoExpandSidebar));
144145
const startupPath = config.value.workspace?.startupPath;
145146
if (startupPath && shouldAutoLoadWorkspace(startupPath)) {
146147
window.electronAPI.workspaceExists(startupPath).then((exists) => {

0 commit comments

Comments
 (0)