fix: table expanded icon render error #4507

pull/4520/head
tangjinzhou 3 years ago
parent 665e5919af
commit 4e14656ef1

@ -1,4 +1,4 @@
import { computed, inject } from 'vue'; import { inject } from 'vue';
import PropTypes from '../../_util/vue-types'; import PropTypes from '../../_util/vue-types';
import TableHeaderRow from './TableHeaderRow'; import TableHeaderRow from './TableHeaderRow';
@ -75,21 +75,20 @@ export default {
columns: PropTypes.array.isRequired, columns: PropTypes.array.isRequired,
expander: PropTypes.object.isRequired, expander: PropTypes.object.isRequired,
}, },
setup(props) { setup() {
return { return {
table: inject('table', {}), table: inject('table', {}),
rows: computed(() => parseHeaderRows(props.columns)),
}; };
}, },
render() { render() {
const { sComponents: components, prefixCls, showHeader, customHeaderRow } = this.table; const { sComponents: components, prefixCls, showHeader, customHeaderRow } = this.table;
const { expander, columns, fixed, rows } = this; const { expander, columns, fixed } = this;
if (!showHeader) { if (!showHeader) {
return null; return null;
} }
const rows = parseHeaderRows(this.columns);
expander.renderExpandIndentCell(rows, fixed); expander.renderExpandIndentCell(rows, fixed);
const HeaderWrapper = components.header.wrapper; const HeaderWrapper = components.header.wrapper;

Loading…
Cancel
Save