我正在尝试更改禁用时选择下拉菜单的背景颜色。
我正在测试:
.ant-select-disabled .ant-select-selection{background-color: red}
,但没有运气。
例如,在常规输入上我让它工作:.ant-input:disabled{background-color: red}
这是针对 VueJS 的
您好,您可以在“选择”下拉列表中使用样式
<Select
style={
backgroundColor: "red",
}
>
.....
</Select>
您可以使用 Select 上的
dropdownStyle
属性来设置其样式。
你可以使用这个;这对我有用。
.ant-select-selection-item{
background-color: red;
}
这对我有用。您必须为 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>