1.3.7
vue
less scoped
使用了自定义类名, :global{} 等.都不能改变select的css.
除非去掉scoped,但是这样会污染我其他的样式..
<a-select defaultValue="架空层" size="small" class="device-select">
<a-select-option value="1">架空层</a-select-option>
<a-select-option value="2">Lucy</a-select-option>
</a-select>
.device-select{
width: 100%;
:global {
.ant-select-selection--single{
background: red; // 不生效
}
}
}
其中 ant-select 可以改css,但是会被其他的select样式盖掉
也可也 scoped
<style lang="less" scoped>
.device-select {
width: 100%;
/deep/ .ant-select-selection--single {
background: red; // 不生效
}
}
</style>
也可也 scoped
<style lang="less" scoped> .device-select { width: 100%; /deep/ .ant-select-selection--single { background: red; // 不生效 } } </style>
这个可以!!!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
也可也 scoped