Skip to content

Commit 759beaf

Browse files
committed
fix:修改element-plus默认语言为中文
1 parent 9237de9 commit 759beaf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {createApp} from 'vue'
22
import { createPinia } from 'pinia'
33
import ElementPlus from 'element-plus'
44
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
5+
import zhCn from 'element-plus/es/locale/lang/zh-cn'
56
import App from './App.vue'
67
import router from './router'
78
import { usePermissStore } from './store/permiss'
@@ -13,7 +14,9 @@ const app = createApp(App)
1314

1415
app.use(createPinia())
1516
app.use(router)
16-
app.use(ElementPlus)
17+
app.use(ElementPlus, {
18+
locale: zhCn,
19+
})
1720
// 注册elementplus图标
1821
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
1922
app.component(key, component)

0 commit comments

Comments
 (0)