updata:更新
This commit is contained in:
parent
376a6950a2
commit
d9829552a0
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ Object.keys(ElIconsModules).forEach((key) => {//循环遍历组件名称
|
|||
}
|
||||
});
|
||||
app.use(I18n)
|
||||
app.use(store)
|
||||
app.use(pinia)
|
||||
app.use(router)
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ export const useSettingStore = defineStore({
|
|||
// 主题颜色
|
||||
primary:PRIMARY_COLOR,
|
||||
// element组件大小
|
||||
globalComSize:'default'
|
||||
globalComSize:'default',
|
||||
// 中英文切换,默认中文
|
||||
language:'zh'
|
||||
},
|
||||
}),
|
||||
getters: {},
|
||||
|
|
|
|||
Loading…
Reference in New Issue