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

View File

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

View File

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

View File

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