elementui plus更换主题颜色——so easy! + i18n 中文

这篇博客介绍了如何在APP.vue文件中使用SCSS定义全局变量,通过改变这些变量实现Element Plus组件库的颜色风格一键切换,无需额外安装任何工具。同时,文章提到了i18n国际化配置,展示了如何引入并使用Element Plus的中文语言包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

想要一次性更换颜色吗?无需安装任何东西

APP.vue 文件中

<style lang="scss">
:root {
    --el-color-primary: #15ae6d;
}
.el-button--primary {
    --el-button-font-color: #ffffff;
    --el-button-background-color: #15ae6d;
    --el-button-border-color: #15ae6d;
    --el-button-hover-color: #15ae6d;
    --el-button-active-font-color: #e6e6e6;
    --el-button-active-background-color: #15ae6d;
    --el-button-active-border-color: #15ae6d;
}
</style>

i18n 国际化

import zhCn from 'element-plus/es/locale/lang/zh-cn'

const app = createApp(App)
app.use(ElementPlus, {
  locale: zhCn,
})
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值