Commit 39ca457e authored by 邓晓峰's avatar 邓晓峰

Merge branch 'fix/updateDeviceTree' into 'dev'

fix: update device tree See merge request !16
parents 7fa415fc 8e845271
Pipeline #25206 failed with stages
in 1 minute 28 seconds
......@@ -79,18 +79,20 @@ const Demo = () => {
};
return (
<PandaDeviceTree
onSearch={onSearch}
checkable
onExpand={onExpand}
expandedKeys={expandedKeys}
autoExpandParent={autoExpandParent}
onCheck={onCheck}
checkedKeys={checkedKeys}
onSelect={onSelect}
selectedKeys={selectedKeys}
treeData={treeData}
/>
<div style={{ width: '300px', height: '400px', border: '1px solid #eee' }}>
<PandaDeviceTree
onSearch={onSearch}
checkable
onExpand={onExpand}
expandedKeys={expandedKeys}
autoExpandParent={autoExpandParent}
onCheck={onCheck}
checkedKeys={checkedKeys}
onSelect={onSelect}
selectedKeys={selectedKeys}
treeData={treeData}
/>
</div>
);
};
......
......@@ -22,8 +22,10 @@ const DeviceTree = (props) => {
onPressEnter={onSearch}
/>
<Divider />
{!!treeData.length && <Tree {...props} />}
{!treeData.length && <Empty />}
<div className={classNames(`${prefixCls}-content`)}>
{!!treeData.length && <Tree {...props} />}
{!treeData.length && <Empty />}
</div>
</div>
);
};
......
......@@ -2,9 +2,18 @@
@device-tree-prefix-cls: ~'@{ant-prefix}-device-tree';
.@{device-tree-prefix-cls} {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
padding: 5px;
.ant-divider {
margin: 6px 0 12px 0;
}
&-content {
flex: 1;
overflow-y: scroll;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment