fix: 兼容children为 null
This commit is contained in:
parent
b897b50b03
commit
15c13a9482
|
@ -1192,7 +1192,7 @@ var _initialiseProps = function _initialiseProps() {
|
|||
children = _props5.children,
|
||||
treeData = _props5.treeData;
|
||||
|
||||
var noTreeNode = typeof children === 'undefined' || (typeof children === 'undefined' ? 'undefined' : _typeof(children)) === 'object' && children.length === 0 || (typeof treeData === 'undefined' ? 'undefined' : _typeof(treeData)) === 'object' && treeData.length === 0;
|
||||
var noTreeNode = children === null || typeof children === 'undefined' || (typeof children === 'undefined' ? 'undefined' : _typeof(children)) === 'object' && children.length === 0 || (typeof treeData === 'undefined' ? 'undefined' : _typeof(treeData)) === 'object' && treeData.length === 0;
|
||||
return !noTreeNode;
|
||||
};
|
||||
|
||||
|
|
|
@ -35474,7 +35474,7 @@
|
|||
children = _props5.children,
|
||||
treeData = _props5.treeData;
|
||||
|
||||
var noTreeNode = typeof children === 'undefined' || (typeof children === 'undefined' ? 'undefined' : _typeof(children)) === 'object' && children.length === 0 || (typeof treeData === 'undefined' ? 'undefined' : _typeof(treeData)) === 'object' && treeData.length === 0;
|
||||
var noTreeNode = children === null || typeof children === 'undefined' || (typeof children === 'undefined' ? 'undefined' : _typeof(children)) === 'object' && children.length === 0 || (typeof treeData === 'undefined' ? 'undefined' : _typeof(treeData)) === 'object' && treeData.length === 0;
|
||||
return !noTreeNode;
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -79,7 +79,7 @@ class Tree extends React.Component {
|
|||
// 判断初始化挂载时,有没有渲染树节点
|
||||
hasTreeNode = () => {
|
||||
const { children, treeData } = this.props;
|
||||
let noTreeNode = typeof children === 'undefined' || (typeof children === 'object' && children.length === 0) || (typeof treeData === 'object' && treeData.length === 0);
|
||||
let noTreeNode = children === null || typeof children === 'undefined' || (typeof children === 'object' && children.length === 0) || (typeof treeData === 'object' && treeData.length === 0);
|
||||
return !noTreeNode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue