Commit 8e845271 authored by 涂茜's avatar 涂茜

fix: update device tree

parent 7fa415fc
Pipeline #25205 failed with stages
in 1 minute 31 seconds
...@@ -79,6 +79,7 @@ const Demo = () => { ...@@ -79,6 +79,7 @@ const Demo = () => {
}; };
return ( return (
<div style={{ width: '300px', height: '400px', border: '1px solid #eee' }}>
<PandaDeviceTree <PandaDeviceTree
onSearch={onSearch} onSearch={onSearch}
checkable checkable
...@@ -91,6 +92,7 @@ const Demo = () => { ...@@ -91,6 +92,7 @@ const Demo = () => {
selectedKeys={selectedKeys} selectedKeys={selectedKeys}
treeData={treeData} treeData={treeData}
/> />
</div>
); );
}; };
......
...@@ -22,9 +22,11 @@ const DeviceTree = (props) => { ...@@ -22,9 +22,11 @@ const DeviceTree = (props) => {
onPressEnter={onSearch} onPressEnter={onSearch}
/> />
<Divider /> <Divider />
<div className={classNames(`${prefixCls}-content`)}>
{!!treeData.length && <Tree {...props} />} {!!treeData.length && <Tree {...props} />}
{!treeData.length && <Empty />} {!treeData.length && <Empty />}
</div> </div>
</div>
); );
}; };
......
...@@ -2,9 +2,18 @@ ...@@ -2,9 +2,18 @@
@device-tree-prefix-cls: ~'@{ant-prefix}-device-tree'; @device-tree-prefix-cls: ~'@{ant-prefix}-device-tree';
.@{device-tree-prefix-cls} { .@{device-tree-prefix-cls} {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
padding: 5px; padding: 5px;
.ant-divider { .ant-divider {
margin: 6px 0 12px 0; 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