Просмотр исходного кода

fix:补充ibps-tree 树数据判断

liujiayin 2 лет назад
Родитель
Сommit
975188a917
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      src/components/ibps-tree/index.vue

+ 5 - 3
src/components/ibps-tree/index.vue

@@ -287,9 +287,11 @@ export default {
             if (val[0] && val[0].children.length && val[0].children.length !== 1) {
                 // 默认打开第三层
                 for (const i of val[0].children) {
-                    this.treeExpandData.push(
-                        i.children.length ? i.children[0].id : i.id
-                    )
+                    if (i.children) {
+                        this.treeExpandData.push(
+                            i.children.length ? i.children[0].id : i.id
+                        )
+                    }
                 }
             }
         }