原因

代码中使用scoped之后,保证各文件中的css不相互影响,给每个component都做了唯一的标记
解决方案如下

<style lang="less" scoped>
//css用 
//.el-table >>> .warning-row
//less sass scss用
.el-table {
  /deep/ .warning-row {
    background: oldlace;
  }
  /deep/ .success-row {
    background: #f0f9eb;
  }
}
</style>

如果/deep/报错可以用如下方法

<style scoped  lang="scss">
.el-table {
  ::v-deep {
    .warning-row {
      background: oldlace;
    }
    .success-row {
      background: #f0f9eb;
    }
  }
}
.editable-add-btn {
  margin-left: 0px;
}
</style>

更多推荐

(精华)2020年10月19日 vue element-ui修改样式不生效