优化Select

master
LiuJiaNan 2025-11-06 16:31:49 +08:00
parent 2bbfa0b022
commit 3246c6aae4
1 changed files with 3 additions and 1 deletions

View File

@ -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 (