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>
相关推荐
Cobyte2 小时前
15.响应式系统比对:链表在 Preact Signals 响应式系统中的应用
前端·javascript·vue.js
jay神3 小时前
基于 Python + Flask + Vue 的校内求职互助平台
前端·vue.js·后端·python·flask·毕业设计
ThinkPet4 小时前
记事-vue3项目整合Agora声网sdk实现RTC视频通话
vue.js·音视频·实时音视频
daols884 小时前
vxe-table 进阶:同时使用 formatter 与 cell-render 实现格式化与样式定制
前端·javascript·vue.js·vxe-table
前端张三4 小时前
ant design vue table 使用虚拟滚动
前端·javascript·vue.js
范什么特西5 小时前
狂神Vue
前端·javascript·vue.js
秋雨梧桐叶落莳5 小时前
iOS——抽屉视图详解
开发语言·macos·ui·ios·objective-c·cocoa
一 乐5 小时前
在线考试|基于Springboot的在线考试管理系统设计与实现(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端·毕设·在线考试管理系统
小拉达不是臭老鼠6 小时前
Unity中的UI系统之UGUI_登陆面板实现
ui·unity
喵了几个咪6 小时前
Headless 后端实践:基于Go的企业级多栈管理系统脚手架
开发语言·vue.js·后端·golang·reactjs·gowind