【发布时间】:2020-08-14 06:31:31
【问题描述】:
我在 reactjs 中使用 material-ui / autoComplete。 在单个区域中搜索。如何让它搜索多个域。
所以我也想添加 customerSurname 字段。
在 customerName 字段上进行搜索。如何搜索 CustomerSurname 和 customerIdentityNo 字段?
<Autocomplete
id={'customer-search'}
options={this.state.customerItems}
getOptionLabel={(option) => option.customerName}
renderOption={(option) => (
<React.Fragment>
<span> {option.customerIdentityNo}, </span>
<span> {option.customerName} {option.customerSurname} </span>
</React.Fragment>
)}
renderInput={(params) => (
<TextField
{...params}
label="Search input"
margin="normal"
variant="outlined"
InputProps={{
...params.InputProps,
type: 'search'
}}
/>
)}
/>
【问题讨论】:
标签: reactjs material-ui