vue踩坑foreach

问题代码

 

报错

TypeError: Cannot read properties of undefined (reading 'forEach')

原因

表达式错误 多了array

正确代码

node.children.forEach(item =>this.getLeafKeys(item,arr));

posted @ 2022-12-17 16:43  心中长亮  阅读(289)  评论(0)    收藏  举报