fix(frontend): 修复纸页刷新宽度并完善侧栏和图表主题

This commit is contained in:
2026-09-05 19:23:21 +08:00
parent a63f6c57e0
commit 8692910508
10 changed files with 165 additions and 35 deletions
@@ -11,11 +11,11 @@ let renderVersion = 0
const diagramTheme = computed<'light' | 'dark'>(() => (themeStore.isDark ? 'dark' : 'light'))
// 主题切换需要重渲染:Mermaid SVG 的配色在渲染时烘焙,无法靠 CSS 变量事后调整。
watch([() => props.source, diagramTheme], async ([source, theme]) => {
watch([() => props.source, diagramTheme, () => themeStore.currentThemeId], async ([source, theme]) => {
const version = ++renderVersion
const result = await renderMarkdown(source, { theme })
if (version === renderVersion) html.value = result
}, { immediate: true })
}, { immediate: true, flush: 'post' })
</script>
<template>