Skip to content

Commit d68ecea

Browse files
committed
fix: Lov初始值可能异常
1 parent 3accbe5 commit d68ecea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/Lov/Lov.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ const Lov: React.FC<LovProps> = (props) => {
3232
(val: any) => {
3333
if (onChange) {
3434
onChange(val);
35-
} else {
35+
} else if (val) {
3636
setLovValue(val instanceof Array ? val : [val]);
37+
} else {
38+
setLovValue([]);
3739
}
3840
},
3941
[onChange],

0 commit comments

Comments
 (0)