ant 设计更改禁用时选择背景颜色

问题描述 投票:0回答:4

我正在尝试更改禁用时选择下拉菜单的背景颜色。

我正在测试:

.ant-select-disabled .ant-select-selection{background-color: red}
,但没有运气。 例如,在常规输入上我让它工作:
.ant-input:disabled{background-color: red}

这是针对 VueJS 的

antd ant-design-pro antdv ant-design-vue
4个回答
0
投票

您好,您可以在“选择”下拉列表中使用样式

<Select
   style={
     backgroundColor: "red",
   }
>
        .....
              
</Select>

0
投票

您可以使用 Select 上的

dropdownStyle
属性来设置其样式。


0
投票

你可以使用这个;这对我有用。

.ant-select-selection-item{
   background-color: red;
}

0
投票

这对我有用。您必须为 Select 组件添加包装组件,然后使用 .ant-select-selector 根据您的需要更改背景属性。

例如:

/**
  change the background color inside of the SelectWrapper
*/

SelectWrapper .ant-select-selector{
  background: <your background> !important;
}

/** 
 '!important' is very important make sure to add it
*/
<SelectWrapper>
  <Select>...</Select>
</SelectWrapper>

© www.soinside.com 2019 - 2024. All rights reserved.