element-ui 修改el-form-item样式

文章目录

  • form结构
  • 修改el-form-item所有样式
  • 只修改label
  • 只修改content
  • 只修改input
  • 只修改button

form结构

html 复制代码
<el-form :model="formData" label-width="80px">
<el-form-item label="label1">
<el-input v-model="formData.value1"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">提交</el-button>
<el-button>取消</el-button>
</el-form-item>
</el-form>

修改el-form-item所有样式

css 复制代码
<style lang="less" scoped>
.el-form {
.el-form-item {
/deep/ * {
font-size: 18px;
color: blue;
}
}
}
</style>

只修改label

css 复制代码
<style lang="less" scoped>
.el-form {
.el-form-item {
/deep/ .el-form-item__label {
font-size: 18px;
color: blue;
}
}
}
</style>

只修改content

css 复制代码
<style lang="less" scoped>
.el-form {
.el-form-item {
/deep/ .el-form-item__content {
* {
font-size: 18px;
color: blue;
}
}
}
}
</style>

只修改input

css 复制代码
<style lang="less" scoped>
.el-form {
.el-form-item {
/deep/ .el-form-item__content {
input {
font-size: 18px;
color: blue;
}
}
}
}
</style>

只修改button

css 复制代码
<style lang="less" scoped>
.el-form {
.el-form-item {
/deep/ .el-form-item__content {
button {
font-size: 18px;
color: blue;
}
}
}
}
</style>
相关推荐
Wang's Blog8 小时前
前端FAQ: Vue 3 与 Vue 2 相⽐有哪些重要的改进?
前端·javascript·vue.js
再希8 小时前
React+Tailwind CSS+Shadcn UI
前端·react.js·ui
ss2738 小时前
Springboot + vue 医院管理系统
vue.js·spring boot·后端
今天也是爱大大的一天吖9 小时前
vue2中的.native修饰符和$listeners组件属性
前端·javascript·vue.js
STUPID MAN11 小时前
Linux使用tomcat发布vue打包的dist或html
linux·vue.js·tomcat·html
JIngJaneIL12 小时前
助农惠农服务平台|助农服务系统|基于SprinBoot+vue的助农服务系统(源码+数据库+文档)
java·前端·数据库·vue.js·论文·毕设·助农惠农服务平台
云外天ノ☼12 小时前
待办事项全栈实现:Vue3 + Node.js (Koa) + MySQL深度整合,构建生产级任务管理系统的技术实践
前端·数据库·vue.js·mysql·vue3·koa·jwt认证
一位搞嵌入式的 genius12 小时前
前端实战开发(三):Vue+Pinia中三大核心问题解决方案!!!
前端·javascript·vue.js·前端实战
前端.火鸡12 小时前
Vue 3.5 新API解析:响应式革命、SSR黑科技与开发体验飞跃
javascript·vue.js·科技
嗝屁小孩纸12 小时前
开发集成热门小游戏(vue+js)
前端·javascript·vue.js