我正在使用下面的带有多个选择的Formik select组件,但我不确定如何使用Material-UI样式(如果可能)或我自己的样式来设计它,至少让它看起来像一个具有一定高度和长度以及圆角边框的Material-UI选择。
请看这里:https://codesandbox.io/s/l313z619l?file=/src/index.js:673-679
发布于 2021-04-26 17:29:33
你能不能只给它添加一个类?以及通过它的风格?
<Field
component="select"
name="names"
className="yourMaterialUI-Select"
// You need to set the new field value
onChange={evt =>
setFieldValue(
"names",
[].slice
.call(evt.target.selectedOptions)
.map(option => option.value)
)
}
multiple={true}
>
{availableSelection.map(s => (
<option key={s} value={s}>
{s}
</option>
))}
</Field>https://stackoverflow.com/questions/67264014
复制相似问题