fix: configure Element Plus Chinese locale (zh-cn)

Add zh-cn locale to Element Plus globally via app.use() and el-config-provider wrapper, and apply :locale prop to all el-date-picker components in dialogs to ensure correct Chinese display in date pickers, calendars, and other locale-aware UI.

Made-with: Cursor
This commit is contained in:
祀梦
2026-03-16 15:47:15 +08:00
parent 473b9052b0
commit 40eb2dadb0
7 changed files with 16 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import { useCategoryStore } from '@/stores/useCategoryStore'
import { useTagStore } from '@/stores/useTagStore'
import { useUIStore } from '@/stores/useUIStore'
import { useUserSettingsStore } from '@/stores/useUserSettingsStore'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import AppHeader from '@/components/AppHeader.vue'
import TaskDialog from '@/components/TaskDialog.vue'
import CategoryDialog from '@/components/CategoryDialog.vue'
@@ -60,6 +61,7 @@ onMounted(async () => {
</script>
<template>
<el-config-provider :locale="zhCn">
<div class="app-container">
<div class="decoration-star" style="top: 20%; right: 8%; animation-delay: 0.5s;"></div>
<div class="decoration-star" style="top: 60%; left: 3%; animation-delay: 1s;"></div>
@@ -97,6 +99,7 @@ onMounted(async () => {
<TaskDialog />
<CategoryDialog />
</div>
</el-config-provider>
</template>
<style scoped lang="scss">