设置用户偏好.

This commit is contained in:
lijiahangmax
2023-09-26 01:11:57 +08:00
parent 99d6d16a04
commit b46541ad36
12 changed files with 243 additions and 205 deletions

View File

@@ -1,15 +1,16 @@
<template>
<a-config-provider :locale="locale">
<router-view />
<global-setting />
<global-setting ref="globalSettingRef" />
</a-config-provider>
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import { computed, provide, ref } from 'vue';
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
import GlobalSetting from '@/components/global-setting/index.vue';
import useLocale from '@/hooks/locale';
import { openGlobalSettingKey } from '@/types/symbol';
const { currentLocale } = useLocale();
const locale = computed(() => {
@@ -20,4 +21,11 @@
return zhCN;
}
});
// 对外暴露打开配置方法
const globalSettingRef = ref();
provide(openGlobalSettingKey, () => {
globalSettingRef.value.open();
});
</script>