fix: table expandedRowRender

pull/2682/head
Amour1688 2020-08-08 16:03:28 +08:00
parent b6a15f5930
commit f0337cebde
4 changed files with 7 additions and 10 deletions

View File

@ -892,8 +892,10 @@ export default {
return ({ expandable, expanded, needIndentSpaced, record, onExpand }) => {
if (expandable) {
return (
<LocaleReceiver componentName="Table" defaultLocale={defaultLocale.Table}>
{locale => (
<LocaleReceiver
componentName="Table"
defaultLocale={defaultLocale.Table}
children={locale => (
<TransButton
class={classNames(`${prefixCls}-row-expand-icon`, {
[`${prefixCls}-row-collapsed`]: !expanded,
@ -906,7 +908,7 @@ export default {
noStyle
/>
)}
</LocaleReceiver>
/>
);
}

View File

@ -18,7 +18,7 @@ const Table = {
const style = element.props?.style || {};
const cls = element.props?.class || '';
const props = getPropsData(element);
const { default: children, ...restSlots } = element.children;
const { default: children, ...restSlots } = element.children || {};
const column = { ...restSlots, ...props, style, class: cls };
if (key) {
column.key = key;

View File

@ -233,7 +233,7 @@ const ExpandableTable = {
const needIndentSpaced = data.some(record => record[childrenColumnName]);
return getSlot(this, 'default', {
...props,
props,
...this.$attrs,
needIndentSpaced,
renderRows: this.renderRows,

View File

@ -175,11 +175,6 @@ export default {
this.debouncedWindowResize = debounce(this.handleWindowResize, 150);
},
provide() {
return {
table: this,
};
},
mounted() {
this.$nextTick(() => {