Commit 5abb0f2b37b35aab211ea17b262c20b4a7dbaea1

Authored by MrAlenZhong
Committed by 蒋琴
1 parent e47c618b

feat: 对BaseTree组件新增treeWrapperClassName属性 (#2217)

src/components/Tree/src/BasicTree.vue
@@ -437,7 +437,7 @@ @@ -437,7 +437,7 @@
437 {extendSlots(slots)} 437 {extendSlots(slots)}
438 </TreeHeader> 438 </TreeHeader>
439 )} 439 )}
440 - <Spin spinning={unref(props.loading)} tip="加载中..."> 440 + <Spin wrapperClassName={unref(props.treeWrapperClassName)} spinning={unref(props.loading)} tip="加载中...">
441 <ScrollContainer style={scrollStyle} v-show={!unref(getNotFound)}> 441 <ScrollContainer style={scrollStyle} v-show={!unref(getNotFound)}>
442 <Tree {...unref(getBindValues)} showIcon={false} treeData={treeData.value} /> 442 <Tree {...unref(getBindValues)} showIcon={false} treeData={treeData.value} />
443 </ScrollContainer> 443 </ScrollContainer>
src/components/Tree/src/types/tree.ts
@@ -134,6 +134,7 @@ export const treeProps = buildProps({ @@ -134,6 +134,7 @@ export const treeProps = buildProps({
134 type: Boolean, 134 type: Boolean,
135 default: false, 135 default: false,
136 }, 136 },
  137 + treeWrapperClassName: String
137 }); 138 });
138 139
139 export type TreeProps = ExtractPropTypes<typeof treeProps>; 140 export type TreeProps = ExtractPropTypes<typeof treeProps>;
src/views/demo/system/account/DeptTree.vue
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 title="部门列表" 4 title="部门列表"
5 toolbar 5 toolbar
6 search 6 search
  7 + treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
7 :clickRowToExpand="false" 8 :clickRowToExpand="false"
8 :treeData="treeData" 9 :treeData="treeData"
9 :fieldNames="{ key: 'id', title: 'deptName' }" 10 :fieldNames="{ key: 'id', title: 'deptName' }"