admin-vben5/packages/business/common-ui/src/preferences/blocks/general/general.vue

31 lines
798 B
Vue
Raw Normal View History

2024-05-19 21:20:42 +08:00
<script setup lang="ts">
2024-05-21 22:14:25 +08:00
import type { SelectListItem } from '@vben/types';
2024-05-19 21:20:42 +08:00
import { $t } from '@vben/locales';
2024-06-08 19:49:06 +08:00
import { SUPPORT_LANGUAGES } from '@vben-core/preferences';
2024-05-19 21:20:42 +08:00
import SelectItem from '../select-item.vue';
2024-05-22 22:03:41 +08:00
import SwitchItem from '../switch-item.vue';
2024-05-19 21:20:42 +08:00
defineOptions({
name: 'PreferenceGeneralConfig',
});
2024-06-09 12:53:38 +08:00
const appLocale = defineModel<string>('appLocale');
const appDynamicTitle = defineModel<boolean>('appDynamicTitle');
2024-05-19 21:20:42 +08:00
2024-06-01 23:15:29 +08:00
const localeItems: SelectListItem[] = SUPPORT_LANGUAGES.map((item) => ({
label: item.text,
value: item.key,
}));
2024-05-19 21:20:42 +08:00
</script>
<template>
2024-06-09 12:53:38 +08:00
<SelectItem v-model="appLocale" :items="localeItems">
2024-06-16 13:43:33 +08:00
{{ $t('preferences.language') }}
2024-05-19 21:20:42 +08:00
</SelectItem>
2024-06-09 12:53:38 +08:00
<SwitchItem v-model="appDynamicTitle">
2024-06-16 13:43:33 +08:00
{{ $t('preferences.dynamic-title') }}
2024-05-25 20:02:21 +08:00
</SwitchItem>
2024-05-19 21:20:42 +08:00
</template>