为了避免全局污染,当前页面样式一般都回会加上scoped属性,但有时候重写组件样式会不生效,此时再需要修改的代码前面加上/deep/即可(切记后面不要有空格,紧跟选择器),具体入下面代码所示
<style lang="scss" scoped>
.report-index-box{
/deep/.selectName {
padding: 0 1vw;
font-size: 1vw;
color: #606266;
}
/deep/.selectMain {
padding:24px 0;
}
/deep/.el-table th.is-leaf {
height: 50px!important;
background: #F8F8F9!important;
}
/deep/.el-table__fixed {
height:auto!important;
bottom: 17px!important;
}
/deep/.el-table__fixed-body-wrapper{
height:auto!important;
bottom: 0px!important;
}
}
</style>
深入理解Vue中scoped样式及/deep/使用
本文详细解析了Vue项目中scoped样式的局限性与/deep/选择器的作用,阐述如何通过/deep/重写组件内部样式,解决样式覆盖难题,提升页面布局的灵活性与美观性。
705

被折叠的 条评论
为什么被折叠?



