Vue引入ElementUIPlus

官方地址:https://element-plus.gitee.io/zh-CN/guide/design.html#%E5%8F%8D%E9%A6%88-feedback

第一步:添加element-plus

# NPM
npm install element-plus --save
# Yarn
yarn add element-plus
# pnpm
pnpm install element-plus

第二步:main文件添加:完整引入

复制代码
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'

const app = createApp(App)

app.use(ElementPlus)
app.mount('#app')
复制代码

国际化

可选配置:Element Plus默认使用的是英语,切换中文

1
2
3
4
5
6
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
 
app.use(ElementPlus, {
  locale: zhCn,
})

欢迎关注作者微信公众号

 

posted @   沾青先生  阅读(585)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示