vue组件写css时,加上scoped后样式不生效
比如下面代码,就不生效
<style lang="scss" scoped>
.el-table td .cell {
min-height: 20px !important;
line-height: 20px !important;
}
</style>
但是加上::v-deep,样式就正常生效,vue官方给出的解决方案
下面是生效代码
<style lang="scss" scoped>
::v-deep .el-table td .cell {
min-height: 20px !important;
line-height: 20px !important;
}
</style>