只有一个节点时不显示
This commit is contained in:
parent
7e0ed4e536
commit
2de131a7a1
|
@ -36,3 +36,4 @@ jspm_packages
|
|||
|
||||
.idea/
|
||||
coverage
|
||||
.DS_Store
|
|
@ -6589,19 +6589,4 @@ input.u-button[type="submit"] {
|
|||
right: 7px;
|
||||
color: rgba(0, 0, 0, 0.65); }
|
||||
|
||||
.u-tree-searchable-filter {
|
||||
color: #f50;
|
||||
transition: all .3s ease; }
|
||||
|
||||
.title-middle {
|
||||
display: inline-block;
|
||||
vertical-align: middle; }
|
||||
|
||||
.edit-icon {
|
||||
float: right;
|
||||
font-size: 14px; }
|
||||
|
||||
.title-con {
|
||||
min-width: 150px; }
|
||||
|
||||
/*# sourceMappingURL=demo.css.map */
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -214,13 +214,14 @@ class TreeNode extends React.Component {
|
|||
}
|
||||
const children = props.children;
|
||||
let newChildren = children;
|
||||
let allTreeNode = undefined;
|
||||
if (Array.isArray(children)) {
|
||||
allTreeNode = children.every(function (item) {
|
||||
return item.type === TreeNode;
|
||||
});
|
||||
}
|
||||
//如果props.children的长度大于0才可以生成子对象
|
||||
if (children && (children.length > 0) &&
|
||||
(children.type === TreeNode ||
|
||||
Array.isArray(children) &&
|
||||
children.every((item) => {
|
||||
return item.type === TreeNode;
|
||||
}))) {
|
||||
if (children && (children.type === TreeNode || allTreeNode)){
|
||||
const cls = {
|
||||
[`${props.prefixCls}-child-tree`]: true,
|
||||
[`${props.prefixCls}-child-tree-open`]: props.expanded,
|
||||
|
|
Loading…
Reference in New Issue