diff --git a/mock/sys/user.ts b/mock/sys/user.ts index f89c0f13..fdf4ba33 100644 --- a/mock/sys/user.ts +++ b/mock/sys/user.ts @@ -6,7 +6,7 @@ function createFakeUserList() { { userId: '1', username: 'vben', - realName: 'Vben', + realName: 'Vben Admin', desc: 'manager', password: '123456', token: 'fakeToken1', diff --git a/src/components/Application/index.ts b/src/components/Application/index.ts index ee01d071..96205d7f 100644 --- a/src/components/Application/index.ts +++ b/src/components/Application/index.ts @@ -1,8 +1,8 @@ -import AppLocalPicker from './src/AppLocalPicker.vue'; +import AppLocalePicker from './src/AppLocalePicker.vue'; import AppPageFooter from './src/AppPageFooter.vue'; import AppLogo from './src/AppLogo.vue'; import { withInstall } from '../util'; -export { AppLocalPicker, AppPageFooter, AppLogo }; +export { AppLocalePicker, AppPageFooter, AppLogo }; -export default withInstall(AppLocalPicker, AppPageFooter, AppLogo); +export default withInstall(AppLocalePicker, AppPageFooter, AppLogo); diff --git a/src/components/Application/src/AppLocalPicker.vue b/src/components/Application/src/AppLocalePicker.vue similarity index 86% rename from src/components/Application/src/AppLocalPicker.vue rename to src/components/Application/src/AppLocalePicker.vue index b30472ef..397203d0 100644 --- a/src/components/Application/src/AppLocalPicker.vue +++ b/src/components/Application/src/AppLocalePicker.vue @@ -4,6 +4,7 @@ :dropMenuList="localeList" :selectedKeys="selectedKeys" @menuEvent="handleMenuEvent" + overlayClassName="app-locale-picker-overlay" > @@ -30,8 +31,12 @@ type: Boolean, default: true, }, + reload: { + type: Boolean, + default: false, + }, }, - setup() { + setup(props) { const { localeList } = useLocaleSetting(); const selectedKeys = ref([]); @@ -50,6 +55,7 @@ function toggleLocale(lang: LocaleType | string) { changeLocale(lang as LocaleType); selectedKeys.value = [lang as string]; + props.reload && location.reload(); } function handleMenuEvent(menu: DropMenu) { @@ -61,7 +67,13 @@ }); -