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

fix: update device tree

parent 7fa415fc
Pipeline #25205 failed with stages
in 1 minute 31 seconds
...@@ -79,18 +79,20 @@ const Demo = () => { ...@@ -79,18 +79,20 @@ const Demo = () => {
}; };
return ( return (
<PandaDeviceTree <div style={{ width: '300px', height: '400px', border: '1px solid #eee' }}>
onSearch={onSearch} <PandaDeviceTree
checkable onSearch={onSearch}
onExpand={onExpand} checkable
expandedKeys={expandedKeys} onExpand={onExpand}
autoExpandParent={autoExpandParent} expandedKeys={expandedKeys}
onCheck={onCheck} autoExpandParent={autoExpandParent}
checkedKeys={checkedKeys} onCheck={onCheck}
onSelect={onSelect} checkedKeys={checkedKeys}
selectedKeys={selectedKeys} onSelect={onSelect}
treeData={treeData} selectedKeys={selectedKeys}
/> treeData={treeData}
/>
</div>
); );
}; };
......
...@@ -22,8 +22,10 @@ const DeviceTree = (props) => { ...@@ -22,8 +22,10 @@ const DeviceTree = (props) => {
onPressEnter={onSearch} onPressEnter={onSearch}
/> />
<Divider /> <Divider />
{!!treeData.length && <Tree {...props} />} <div className={classNames(`${prefixCls}-content`)}>
{!treeData.length && <Empty />} {!!treeData.length && <Tree {...props} />}
{!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