fix: table expandIcon not work #3013
parent
5dbcba196f
commit
323647114d
|
@ -903,7 +903,10 @@ export default defineComponent({
|
||||||
: item,
|
: item,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
renderExpandIcon(prefixCls) {
|
renderExpandIcon(prefixCls: string) {
|
||||||
|
if (this.expandIcon) {
|
||||||
|
return this.expandIcon;
|
||||||
|
}
|
||||||
return ({ expandable, expanded, needIndentSpaced, record, onExpand }) => {
|
return ({ expandable, expanded, needIndentSpaced, record, onExpand }) => {
|
||||||
if (expandable) {
|
if (expandable) {
|
||||||
return (
|
return (
|
||||||
|
@ -916,7 +919,7 @@ export default defineComponent({
|
||||||
[`${prefixCls}-row-collapsed`]: !expanded,
|
[`${prefixCls}-row-collapsed`]: !expanded,
|
||||||
[`${prefixCls}-row-expanded`]: expanded,
|
[`${prefixCls}-row-expanded`]: expanded,
|
||||||
})}
|
})}
|
||||||
onClick={event => {
|
onClick={(event: Event) => {
|
||||||
onExpand(record, event);
|
onExpand(record, event);
|
||||||
}}
|
}}
|
||||||
aria-label={expanded ? locale.collapse : locale.expand}
|
aria-label={expanded ? locale.collapse : locale.expand}
|
||||||
|
|
|
@ -69,6 +69,7 @@ const Table = defineComponent({
|
||||||
title: slotTitle,
|
title: slotTitle,
|
||||||
footer: slotFooter,
|
footer: slotFooter,
|
||||||
expandedRowRender = props.expandedRowRender,
|
expandedRowRender = props.expandedRowRender,
|
||||||
|
expandIcon,
|
||||||
} = $slots;
|
} = $slots;
|
||||||
title = title || slotTitle;
|
title = title || slotTitle;
|
||||||
footer = footer || slotFooter;
|
footer = footer || slotFooter;
|
||||||
|
@ -78,6 +79,7 @@ const Table = defineComponent({
|
||||||
title,
|
title,
|
||||||
footer,
|
footer,
|
||||||
expandedRowRender,
|
expandedRowRender,
|
||||||
|
expandIcon: this.$props.expandIcon || expandIcon,
|
||||||
};
|
};
|
||||||
return <T {...tProps} ref="table" />;
|
return <T {...tProps} ref="table" />;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue