mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
fix: 修复Tree添加元素问题 (#6616)
This commit is contained in:
parent
ad93bb9956
commit
543c85dfdd
@ -612,9 +612,10 @@ export class TreeSelector extends React.Component<
|
|||||||
const result = [] as Option[];
|
const result = [] as Option[];
|
||||||
|
|
||||||
for (let option of this.state.flattenedOptions) {
|
for (let option of this.state.flattenedOptions) {
|
||||||
result.push(option);
|
|
||||||
if (option === parent) {
|
if (option === parent) {
|
||||||
result.push({...option, isAdding: true});
|
result.push({...option, isAdding: true});
|
||||||
|
} else {
|
||||||
|
result.push(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setState({flattenedOptions: result});
|
this.setState({flattenedOptions: result});
|
||||||
|
Loading…
Reference in New Issue
Block a user