refactor(project): business changed its name to effects, and universal-ui changed its name to common-ui

This commit is contained in:
vben
2024-07-13 17:25:15 +08:00
parent 5e0b01c725
commit 7eff46d80c
186 changed files with 110 additions and 107 deletions

View File

@@ -0,0 +1,43 @@
<script setup lang="ts">
import type { SupportedLanguagesType } from '@vben-core/typings';
import { IcBaselineLanguage } from '@vben-core/iconify';
import { loadLocaleMessages } from '@vben-core/locales';
import {
SUPPORT_LANGUAGES,
preferences,
updatePreferences,
} from '@vben-core/preferences';
import { VbenDropdownRadioMenu, VbenIconButton } from '@vben-core/shadcn-ui';
defineOptions({
name: 'LanguageToggle',
});
const menus = SUPPORT_LANGUAGES;
async function handleUpdate(value: string) {
const locale = value as SupportedLanguagesType;
updatePreferences({
app: {
locale,
},
});
// 更改预览
await loadLocaleMessages(locale);
}
</script>
<template>
<div>
<VbenDropdownRadioMenu
:menus="menus"
:model-value="preferences.app.locale"
@update:model-value="handleUpdate"
>
<VbenIconButton>
<IcBaselineLanguage class="size-5" />
</VbenIconButton>
</VbenDropdownRadioMenu>
</div>
</template>