优化Select
parent
2bbfa0b022
commit
3246c6aae4
|
|
@ -6,6 +6,7 @@ import { getLabelName } from "../../../utils";
|
|||
*/
|
||||
function BasicSelect(props) {
|
||||
const {
|
||||
onChange,
|
||||
onGetLabel,
|
||||
placeholder = "",
|
||||
data = [],
|
||||
|
|
@ -14,11 +15,12 @@ function BasicSelect(props) {
|
|||
...restProps
|
||||
} = props;
|
||||
|
||||
const handleChange = (event) => {
|
||||
const handleChange = (event, option) => {
|
||||
if (event)
|
||||
onGetLabel?.(getLabelName({ list: data, status: event, idKey, nameKey }));
|
||||
else
|
||||
onGetLabel?.("");
|
||||
onChange?.(event, option);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in New Issue