This commit is contained in:
wanghaoo 2018-11-02 10:23:52 +08:00
parent cff670c12a
commit 2bd467a470
3 changed files with 18 additions and 14 deletions

View File

@ -5,11 +5,7 @@
/* Navlayout */
.u-checkbox {
display: inline-block;
position: relative;
margin: 0 5px;
height: 18px;
line-height: 18px;
font-size: 14px; }
position: relative; }
.u-checkbox.disabled .u-checkbox-label {
cursor: not-allowed;
opacity: 0.5; }
@ -48,7 +44,7 @@
width: 18px;
height: 18px;
left: 0;
top: 0;
top: 4px;
text-align: center;
position: absolute; }
.u-checkbox .u-checkbox-label:after {
@ -58,7 +54,7 @@
width: 18px;
height: 18px;
left: 0;
top: 0;
top: 4px;
text-align: center;
position: absolute; }

View File

@ -271,14 +271,22 @@ var TreeNode = function (_React$Component) {
}
var children = props.children;
var newChildren = children;
var allTreeNode = undefined;
// 确定所有子节点是否是TreeNode
var allTreeNode = false;
if (Array.isArray(children)) {
allTreeNode = children.every(function (item) {
return item.type === TreeNode;
});
for (var index = 0; index < children.length; index++) {
var item = children[index];
allTreeNode = item.type.isTreeNode == 1;
if (!allTreeNode) {
//当检查到子节点中有不是 TreeNode 的,则直接结束检查。同时不会渲染所有子节点
break;
}
}
} else if (children && children.type && children.type.isTreeNode == 1) {
allTreeNode = true;
}
//如果props.children的长度大于0才可以生成子对象
if (children && children.length > 0 && (children.type === TreeNode || allTreeNode)) {
// 如果props.children的长度大于0才可以生成子对象
if (allTreeNode && _react2["default"].Children.count(children)) {
var _cls;
var cls = (_cls = {}, _defineProperty(_cls, props.prefixCls + '-child-tree', true), _defineProperty(_cls, props.prefixCls + '-child-tree-open', props.expanded), _cls);

View File

@ -1,6 +1,6 @@
{
"name": "bee-tree",
"version": "1.1.4",
"version": "1.1.5",
"description": "Tree ui component for react",
"keywords": [
"react",