ElementPlus国际化(将组件的默认语言改为中文)

1. Element-plus的默认语言

Element-plus的默认语言是英语,可修改为其它语言

2. 编辑 main.js 文件

import {createApp} from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import App from './App.vue'

const app = createApp(App)
app.use(ElementPlus, {locale: zhCn})
app.mount('#app')

关键代码:

  • import zhCn from 'element-plus/es/locale/lang/zh-cn'
  • app.use(ElementPlus, {locale: zhCn})

更多语言选项请参考ElementPlus官网:国际化

3. 效果(以分页条组件为例)

修改为中文前

在这里插入图片描述


修改为中文后

在这里插入图片描述

相关推荐

  1. 如何Git语言设置中文

    2024-06-13 22:56:02       64 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-13 22:56:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-13 22:56:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-06-13 22:56:02       87 阅读
  4. Python语言-面向对象

    2024-06-13 22:56:02       96 阅读

热门阅读

  1. 英伟达SSD视觉算法模型训练代码解析

    2024-06-13 22:56:02       28 阅读
  2. Stable Diffusion 3 开源发布可下载体验

    2024-06-13 22:56:02       41 阅读
  3. Python PDF转化wolrd代码怎么写

    2024-06-13 22:56:02       32 阅读
  4. 【React】在 React 组件中,怎么使用useContext

    2024-06-13 22:56:02       32 阅读
  5. Cohere reranker 一致的排序器

    2024-06-13 22:56:02       37 阅读
  6. C# —— 逻辑运算符

    2024-06-13 22:56:02       33 阅读
  7. 异界传说-如何应对甲方提出的不合理需求

    2024-06-13 22:56:02       31 阅读
  8. MySQL(3)

    2024-06-13 22:56:02       30 阅读
  9. Android Unable to determine activity name

    2024-06-13 22:56:02       30 阅读