chore(app): 引入 Day.js

This commit is contained in:
2024-09-08 16:04:20 +08:00
parent 0d30d6cb5a
commit 10ab2fb670

View File

@@ -4,6 +4,12 @@ import { router } from './router';
import '@mdi/font/css/materialdesignicons.css'; import '@mdi/font/css/materialdesignicons.css';
import '@/assets/fonts/index.css'; import '@/assets/fonts/index.css';
import dayjs from 'dayjs';
import dayjsDuration from 'dayjs/plugin/duration';
import 'dayjs/locale/zh-cn';
import 'dayjs/locale/zh-hk';
import lunisolar from 'lunisolar'; import lunisolar from 'lunisolar';
import lunisolarLang1 from 'lunisolar/locale/en'; import lunisolarLang1 from 'lunisolar/locale/en';
import lunisolarLang2 from 'lunisolar/locale/zh-cn'; import lunisolarLang2 from 'lunisolar/locale/zh-cn';
@@ -11,6 +17,12 @@ import lunisolarFestivals from 'lunisolar/markers/festivals.zh-cn';
import App from './App.vue'; import App from './App.vue';
// 加载 Day.js Duration 插件
dayjs.extend(dayjsDuration);
// 配置 Day.js 默认语言
dayjs.locale('zh-cn');
// 加载 Lunisolar 语言包 // 加载 Lunisolar 语言包
lunisolar.locale([ lunisolar.locale([
lunisolarLang1, lunisolarLang1,