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>
相关推荐
TE-茶叶蛋9 小时前
Vue Fragment vs React Fragment
javascript·vue.js·react.js
Angindem9 小时前
从零搭建uniapp项目
前端·vue.js·uni-app
前端小白从0开始11 小时前
Vue3项目实现WPS文件预览和内容回填功能
前端·javascript·vue.js·html5·wps·文档回填·文档在线预览
難釋懷11 小时前
Vue解决开发环境 Ajax 跨域问题
前端·vue.js·ajax
挑战者66688812 小时前
vue入门环境搭建及demo运行
前端·javascript·vue.js
程序猿ZhangSir14 小时前
Vue3 项目的基本架构解读
前端·javascript·vue.js
亲亲小宝宝鸭15 小时前
写了两个小需求,终于搞清楚了表格合并
前端·vue.js
Face15 小时前
路由Vue-router 及 异步组件
前端·javascript·vue.js
Humbunklung15 小时前
Rust Floem UI 框架使用简介
开发语言·ui·rust
风之舞_yjf16 小时前
Vue基础(14)_列表过滤、列表排序
前端·javascript·vue.js