updata:更新

This commit is contained in:
zouzhibing 2022-08-31 11:36:02 +08:00
parent 376a6950a2
commit d9829552a0
3 changed files with 7 additions and 7 deletions

View File

@ -14,18 +14,17 @@
</template>
<script lang="ts" setup>
import {useStore} from "vuex";
import {useSettingStore} from "@/store/modules/setting"
import { useI18n } from "vue-i18n";
import {computed, reactive} from "vue";
const store = useStore()
const SettingStore = useSettingStore()
const i18n = useI18n();
const language = computed(():string=>store.state.setting.themeConfig.language)
const language = computed(():string=>SettingStore.themeConfig.language)
const setLanguage = (val)=>{
i18n.locale.value = val;
store.dispatch('setting/setThemeConfig', {key:'language', val})
SettingStore.setThemeConfig({key:'language', val})
}
</script>

View File

@ -39,7 +39,6 @@ Object.keys(ElIconsModules).forEach((key) => {//循环遍历组件名称
}
});
app.use(I18n)
app.use(store)
app.use(pinia)
app.use(router)

View File

@ -31,7 +31,9 @@ export const useSettingStore = defineStore({
// 主题颜色
primary:PRIMARY_COLOR,
// element组件大小
globalComSize:'default'
globalComSize:'default',
// 中英文切换,默认中文
language:'zh'
},
}),
getters: {},