parent
2de131a7a1
commit
ac619e194c
|
@ -255,10 +255,14 @@ var TreeNode = function (_React$Component) {
|
|||
}
|
||||
var children = props.children;
|
||||
var newChildren = children;
|
||||
var 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(function (item) {
|
||||
return item.type === TreeNode;
|
||||
}))) {
|
||||
if (children && (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);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bee-tree",
|
||||
"version": "1.0.9",
|
||||
"version": "1.1.0",
|
||||
"description": "Tree ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
Loading…
Reference in New Issue