Ant-design-vue: 为什么antd-select修改不了css

Created on 28 Mar 2019  ·  4Comments  ·  Source: vueComponent/ant-design-vue

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.3.7

Environment

vue

Steps to reproduce

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样式盖掉

outdated

Most helpful comment

也可也 scoped

<style lang="less" scoped>
.device-select {
  width: 100%;
  /deep/ .ant-select-selection--single {
    background: red; // 不生效
  }
}
</style>

All 4 comments

也可也 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.

Was this page helpful?
0 / 5 - 0 ratings