children长度为0时不显示图标

This commit is contained in:
wanghaoo 2018-08-14 15:08:39 +08:00
parent a3d56465c2
commit 1496d42928
3 changed files with 3 additions and 3 deletions

2
dist/demo.js vendored
View File

@ -7792,7 +7792,7 @@
});
}
//如果props.children的长度大于0才可以生成子对象
if (children && (children.type === TreeNode || allTreeNode)) {
if (children && children.length > 0 && (children.type === TreeNode || allTreeNode)) {
var _cls;
var cls = (_cls = {}, _defineProperty(_cls, props.prefixCls + '-child-tree', true), _defineProperty(_cls, props.prefixCls + '-child-tree-open', props.expanded), _cls);

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -241,7 +241,7 @@ class TreeNode extends React.Component {
});
}
//如果props.children的长度大于0才可以生成子对象
if (children && (children.type === TreeNode || allTreeNode)){
if (children && (children.length > 0) && (children.type === TreeNode || allTreeNode)){
const cls = {
[`${props.prefixCls}-child-tree`]: true,
[`${props.prefixCls}-child-tree-open`]: props.expanded,