feat(table): support expandIcon slot (#4448)

close #4444
pull/4516/head
zkwolf 2021-08-02 17:09:22 +08:00 committed by GitHub
parent 4c559c86ab
commit b0d226d33e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -1146,7 +1146,9 @@ export default {
getPopupContainer: contextGetPopupContainer,
transformCellText,
}) {
const { showHeader, locale, getPopupContainer, ...restProps } = getOptionProps(this);
const { showHeader, locale, getPopupContainer, expandIcon, ...restProps } = getOptionProps(
this,
);
const data = this.getCurrentPageData();
const expandIconAsCell = this.expandedRowRender && this.expandIconAsCell !== false;
@ -1190,7 +1192,7 @@ export default {
const vcTableProps = {
key: 'table',
props: {
expandIcon: this.renderExpandIcon(prefixCls),
expandIcon: expandIcon || this.renderExpandIcon(prefixCls),
...restProps,
customRow: (record, index) => this.onRow(prefixCls, record, index),
components: this.sComponents,

View File

@ -112,6 +112,7 @@ const Table = {
title: slotTitle,
footer: slotFooter,
expandedRowRender = props.expandedRowRender,
expandIcon,
} = $scopedSlots;
title = title || slotTitle;
footer = footer || slotFooter;
@ -122,6 +123,7 @@ const Table = {
title,
footer,
expandedRowRender,
expandIcon: this.$props.expandIcon || expandIcon,
},
on: getListeners(this),
};