children长度为0时不显示图标
This commit is contained in:
parent
a3d56465c2
commit
1496d42928
|
@ -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);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue