优化pinia持久化

This commit is contained in:
2026-01-15 09:51:59 +08:00
parent bb1ed16d8b
commit ab737f8a75
9 changed files with 239 additions and 155 deletions

View File

@@ -1,4 +1,14 @@
<script setup></script>
<script setup>
import { onMounted } from 'vue'
import { useI18nStore } from './stores/modules/i18n'
import i18n from './i18n'
onMounted(() => {
// 从持久化的 store 中读取语言设置并同步到 i18n
const i18nStore = useI18nStore()
i18n.global.locale.value = i18nStore.currentLocale
})
</script>
<template>
<router-view />