fix(frontend): 接通设置状态与搜索降级

This commit is contained in:
2026-08-29 23:59:22 +08:00
parent d6f6b7e6e2
commit cd405da21c
8 changed files with 105 additions and 23 deletions
+9 -1
View File
@@ -1,9 +1,10 @@
<script setup lang="ts">
import { computed } from 'vue'
import { computed, onMounted, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useWorkspaceStore } from '@/stores/workspace'
import { useThemeStore } from '@/stores/theme'
import { useEditorStore } from '@/stores/editor'
import { useSettingsStore } from '@/stores/settings'
import PrimarySidebar from './PrimarySidebar.vue'
import SecondarySidebar from './SecondarySidebar.vue'
import StatusBar from './StatusBar.vue'
@@ -17,9 +18,16 @@ defineProps<{
const workspaceStore = useWorkspaceStore()
const themeStore = useThemeStore()
const editorStore = useEditorStore()
const settingsStore = useSettingsStore()
const route = useRoute()
const router = useRouter()
onMounted(() => { void settingsStore.loadDiagnostics() })
watch(() => settingsStore.defaultEditorMode, (mode) => editorStore.setMode(mode), { immediate: true })
watch(() => settingsStore.editorLineWidth, (width) => {
document.documentElement.style.setProperty('--editor-line-width', `${width}ch`)
}, { immediate: true })
const routeName = computed(() => route.name as string)
const secondaryComponent = computed(() => {
@@ -19,9 +19,7 @@ const navItems = [
]
const currentName = computed(() => {
const name = route.name as string
if (name === 'skills' || name === 'plugins') return 'skills'
return name
return route.name as string
})
function navigate(name: string) {