mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
考虑 withChildren 的情况
This commit is contained in:
parent
0b69f5ed1b
commit
2975f1f0b2
@ -294,12 +294,14 @@ export class TreeSelector extends React.Component<
|
|||||||
if (
|
if (
|
||||||
parent.children.every((child: any) => ~value.indexOf(child))
|
parent.children.every((child: any) => ~value.indexOf(child))
|
||||||
) {
|
) {
|
||||||
|
if (!props.withChildren) {
|
||||||
parent.children.forEach((child: any) => {
|
parent.children.forEach((child: any) => {
|
||||||
const index = value.indexOf(child);
|
const index = value.indexOf(child);
|
||||||
if (~index) {
|
if (~index) {
|
||||||
value.splice(index, 1);
|
value.splice(index, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
value.push(parent);
|
value.push(parent);
|
||||||
toCheck = parent;
|
toCheck = parent;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user