|
|
@@ -1,3 +1,30 @@
|
|
|
<template>
|
|
|
- <router-view />
|
|
|
+ <a-config-provider :locale="locale">
|
|
|
+ <router-view />
|
|
|
+ </a-config-provider>
|
|
|
</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, computed } from 'vue';
|
|
|
+import { useLocaleStore } from './base/store/use-locale';
|
|
|
+
|
|
|
+/**
|
|
|
+ * @see https://arco.design/vue/component/config-provider
|
|
|
+ */
|
|
|
+import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
|
|
|
+import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
|
|
|
+
|
|
|
+const locales = {
|
|
|
+ zh: zhCN,
|
|
|
+ en: enUS
|
|
|
+};
|
|
|
+
|
|
|
+const localStore = useLocaleStore();
|
|
|
+
|
|
|
+/**
|
|
|
+ * 多语言
|
|
|
+ */
|
|
|
+const locale = computed(() => {
|
|
|
+ return locales[localStore.value] || zhCN;
|
|
|
+});
|
|
|
+</script>
|