feat: Support dayjs and component library in multiple languages

This commit is contained in:
vben
2024-06-30 15:42:30 +08:00
parent ca1cad0cd3
commit 1d70d71537
15 changed files with 99 additions and 20 deletions

View File

@@ -5,15 +5,11 @@ import { GlobalProvider } from '@vben/widgets';
import { preferences, usePreferences } from '@vben-core/preferences';
import { App, ConfigProvider, theme } from 'ant-design-vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import { antdLocale } from '#/forward';
defineOptions({ name: 'App' });
dayjs.locale(zhCN.locale);
const { isDark } = usePreferences();
const tokenTheme = computed(() => {
@@ -35,7 +31,7 @@ const tokenTheme = computed(() => {
<template>
<GlobalProvider>
<ConfigProvider :locale="zhCN" :theme="tokenTheme">
<ConfigProvider :locale="antdLocale" :theme="tokenTheme">
<App>
<RouterView />
</App>