mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-13 11:34:02 +08:00
Tree: fix insertChild (#21194)
This commit is contained in:
@@ -220,7 +220,7 @@ export default class Node {
|
||||
|
||||
if (!(child instanceof Node)) {
|
||||
if (!batch) {
|
||||
const children = this.getChildren(true);
|
||||
const children = this.getChildren(true) || [];
|
||||
if (children.indexOf(child.data) === -1) {
|
||||
if (typeof index === 'undefined' || index < 0) {
|
||||
children.push(child.data);
|
||||
|
||||
Reference in New Issue
Block a user