Skip to content

Commit

Permalink
♻️ Refactoring code. 优化I18N 适配 element-plus 最新版本
Browse files Browse the repository at this point in the history
  • Loading branch information
lbw committed Jan 3, 2024
1 parent 1404060 commit be7086e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { useThemeConfig } from '/@/stores/themeConfig';
*/

// element plus 自带国际化
import enLocale from 'element-plus/lib/locale/lang/en';
import zhcnLocale from 'element-plus/lib/locale/lang/zh-cn';
import enLocale from 'element-plus/es/locale/lang/en';
import zhcnLocale from 'element-plus/es/locale/lang/zh-cn';

// 定义变量内容
const messages = {};
Expand Down
1 change: 1 addition & 0 deletions src/i18n/pages/form/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default {
delBtn: 'Delete',
detailBtn: 'Details',
exportBtn: 'Export',
viewBtn: 'View',
expandBtn: 'expand/phrase ',
refreshCacheBtn: 'Refresh cache',
importBtn: 'Import',
Expand Down
1 change: 1 addition & 0 deletions src/i18n/pages/form/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
editBtn: '修 改',
expandBtn: '展开/折叠',
delBtn: '删除',
viewBtn: '查看',
detailBtn: '详情',
refreshCacheBtn: '刷新缓存',
exportBtn: '导出',
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
resolve: { alias }, // 路径别名配置
base: mode.command === 'serve' ? './' : env.VITE_PUBLIC_PATH,
optimizeDeps: {
include: ['element-plus/lib/locale/lang/zh-cn', 'element-plus/lib/locale/lang/en'],
include: ['element-plus/es/locale/lang/zh-cn', 'element-plus/es/locale/lang/en'],
},
server: {
host: '0.0.0.0', // 服务器地址
Expand Down

0 comments on commit be7086e

Please sign in to comment.