Skip to content

Commit 60aaf14

Browse files
committed
feat(table): support expandIcon slot
1 parent 74007fb commit 60aaf14

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

components/table/Table.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,9 @@ export default {
11461146
getPopupContainer: contextGetPopupContainer,
11471147
transformCellText,
11481148
}) {
1149-
const { showHeader, locale, getPopupContainer, ...restProps } = getOptionProps(this);
1149+
const { showHeader, locale, getPopupContainer, expandIcon, ...restProps } = getOptionProps(
1150+
this,
1151+
);
11501152
const data = this.getCurrentPageData();
11511153
const expandIconAsCell = this.expandedRowRender && this.expandIconAsCell !== false;
11521154

@@ -1190,7 +1192,7 @@ export default {
11901192
const vcTableProps = {
11911193
key: 'table',
11921194
props: {
1193-
expandIcon: this.renderExpandIcon(prefixCls),
1195+
expandIcon: expandIcon || this.renderExpandIcon(prefixCls),
11941196
...restProps,
11951197
customRow: (record, index) => this.onRow(prefixCls, record, index),
11961198
components: this.sComponents,

components/table/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ const Table = {
112112
title: slotTitle,
113113
footer: slotFooter,
114114
expandedRowRender = props.expandedRowRender,
115+
expandIcon = props.expandIcon,
115116
} = $scopedSlots;
116117
title = title || slotTitle;
117118
footer = footer || slotFooter;
@@ -122,6 +123,7 @@ const Table = {
122123
title,
123124
footer,
124125
expandedRowRender,
126+
expandIcon,
125127
},
126128
on: getListeners(this),
127129
};

0 commit comments

Comments
 (0)