ElemeFE / ElemeFE/element-react

Tree组件lazy:true时isLeaf属性无效

Open
#765 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.8k
Forks
435
PR merge metrics
No merged PRs in 30d

Description

指定load方法,load方法的部分内容如下:
```javascript
let children = [];
for(let file of files){
let {filename,...other} = file;
let fileLeaf = {filename:filename,children:[],path:path+'/'+filename,isLeaf:!file.attrs.dir,...other};
children.push(fileLeaf);
}
resolve(children);
```
指定的isLeaf属性无效,使用react-dev-tool审查Node节点时,Props下nodeModel属性无法展开,在Console面板显示错误信息
```
Uncaught TypeError: Cannot read property 'props' of undefinedgetPropertyFromData @ gateway.js:18942
get @ gateway.js:19302(anonymous function) @ backend.js:7516_
inspectResponse @ backend.js:7512
_handleMessage @ backend.js:7393
listener @ backend.js:86
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.