【发布时间】:2021-10-05 23:29:45
【问题描述】:
【问题讨论】:
-
“蓝色轮廓”是指光标吗?
-
黑色光标在蓝色轮廓框内
标签: reactjs react-select
【问题讨论】:
标签: reactjs react-select
您需要传递自定义样式属性。
类似的东西
const customStyles = {
control: (base, state) => ({
...base,
height: "100%",
minHeight: "100%",
border: 0,
boxShadow: "none",
}),
dropdownIndicator: (base, state) => {
return {
...base,
};
},
placeholder: (base, state) => ({
...base,
}),
singleValue: (base, state) => ({
...base,
}),
option: (base, state) => ({
...base,
}),
};
return (
<Select
//REST OF YOUR PROPS
styles={customStyles}
isSearchable={false} //This gets rid of the default cursor
/>
)
尝试使用 customStyles 对象来进一步设置它的样式:)
【讨论】:
默认样式派生自主题对象,您可以像样式一样对其进行变异。
主题对象也可用于样式功能。
<Select
label="Single select"
options={user}
theme={theme => ({
...theme,
borderRadius: 'none',
colors: {
...theme.colors,
primary25: 'primary',
primary: 'neutral5',
},
})}
/>
【讨论】:
常量样式 = { 控制:基地=>({ ...根据, 边界:0, boxShadow:'无' }) };
【讨论】: