vue踩坑foreach
问题代码
报错
TypeError: Cannot read properties of undefined (reading 'forEach')
原因
表达式错误 多了array
正确代码
node.children.forEach(item =>this.getLeafKeys(item,arr));
问题代码
报错
TypeError: Cannot read properties of undefined (reading 'forEach')
原因
表达式错误 多了array
正确代码
node.children.forEach(item =>this.getLeafKeys(item,arr));