|
|
@@ -19,6 +19,7 @@ import { computed } from 'vue'
|
|
|
import { ArrowDown } from '@element-plus/icons-vue'
|
|
|
import { Icon } from '@iconify/vue'
|
|
|
import { useAppStore } from '@/store/app'
|
|
|
+import i18n from '@/locales'
|
|
|
|
|
|
const appStore = useAppStore()
|
|
|
|
|
|
@@ -27,7 +28,9 @@ const currentLangLabel = computed(() => {
|
|
|
})
|
|
|
|
|
|
function handleLanguage(lang: string) {
|
|
|
- appStore.changeLanguage(lang)
|
|
|
+ // 直接设置 store 的 language 值和 i18n locale
|
|
|
+ appStore.language = lang
|
|
|
+ i18n.global.locale.value = lang
|
|
|
}
|
|
|
</script>
|
|
|
|