用elementUI的时候发现在style里面修改样式不生效,即使加了!important也不行,取消掉scope有时候又可以了
但是在组件的style取消了scoped 后,父组件的样式将会渗透到子组件中。
这时候可以使用深度作用选择器 /deep/ 或者'>>>'来解决这个问题 ,但注意像sass、less预处理器不认三个箭头

.el-table--enable-row-hover /deep/ .el-table__body tr:hover>td {
    color: red ;
}
Last modification:May 14, 2021
If you think my article is useful to you, please feel free to appreciate