vue文件中,如果写在有scoped属性的style标签里,CSS覆盖的样式不会生效!
下面是修改方法
方式一:/deep/ 深度修改标签样式
例子:
#test /deep/ .el-input__inner{
height: 30px;
}
方式二:>>> 只能用在原生 CSS 语法中,不能在 css 预处理器如 less scss 等直接使用
.my >>> .el-input__inner{
height: 30px;
}
方法三:在css预处理器中使用 ::v-deep
<style scoped lang='scss'>
.my ::v-deep .el-input__inner{
height: 30px;
.span{
color: #fff;
}
}
</style>