fix: table expandedRowRender
parent
b6a15f5930
commit
f0337cebde
|
@ -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>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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(() => {
|
||||||
|
|
Loading…
Reference in New Issue