vue中Element-ui样式修改

下拉框(el-dropdown)
// hover 下拉框的hover效果
.el-dropdown-menu__item:focus, .el-dropdown-menu__item:not(.is-disabled):hover{
    background: $bgmColor !important;
    transition: background 1.9s;
}
面包屑的字体(el-breadcrumb)
.home .el-breadcrumb__inner a,
.home .el-breadcrumb__inner.is-link {
    color: $fontColor;
    font-weight: normal;
}
表格样式(el-table)
.el-table {
  margin-top: 20px;
  height: 684px;
  // 标题行样式修改
  thead th {
    height: 38px;
    background: $tablesColor;
    transition: background 2s;
  }
  // 奇数行背景修改
  tbody tr {
    height: 38PX;
    background: $tablesColor;
    color: $fontColor;
    transition: background 2s;
  }
  // 偶数行背景修改
  tbody .el-table__row--striped td {
    height: 38px;
    background: $tableColor !important;
    transition: background 2s;
  }
}
输入框 (el-input)
// 输入框
.el-input__inner {
  border-radius: 10px;
  height: 30px;
  line-height: 30px;
  background: $inputColor;
  transition: background 2s;
  // input提示框字体样式修改
  ::placeholder {
    font-size: 18px;
    font-weight: 400;
    color: $fontColor;
  }
}
element-ui 修改注意点

当无法修改时,可以尝试一下几种方法

  1. /deep/
	// 输入框
/deep/ .el-input__inner {
  border-radius: 10px;
  height: 30px;
  line-height: 30px;
  background: $inputColor;
  transition: background 2s;
  ::placeholder {
    font-size: 18px;
    font-weight: 400;
    color: $fontColor;
  }
}
  1. 去除scoped (不推荐)
<style lang='scss' scoped>
   // 往往这样我会给这个组件定义一个独一无二父级,避免样式冲突
   .box{
   .el-input{
   }	
}
<style>
  1. 定义全局样式文件 (此方法推荐公共样式管理时使用)
// 在main.js中引入此文件
import './styles/publiStyle.scss'
  • 6
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值