table ellipsis not work at fixed column
parent
db63f369e1
commit
cd52fec722
|
@ -141,7 +141,7 @@ const BaseTable = {
|
||||||
render() {
|
render() {
|
||||||
const { sComponents: components, prefixCls, scroll, data } = this.table;
|
const { sComponents: components, prefixCls, scroll, data } = this.table;
|
||||||
const { expander, tableClassName, hasHead, hasBody, fixed, isAnyColumnsFixed } = this.$props;
|
const { expander, tableClassName, hasHead, hasBody, fixed, isAnyColumnsFixed } = this.$props;
|
||||||
|
const columns = this.getColumns();
|
||||||
const tableStyle = {};
|
const tableStyle = {};
|
||||||
|
|
||||||
if (!fixed && scroll.x) {
|
if (!fixed && scroll.x) {
|
||||||
|
@ -153,6 +153,14 @@ const BaseTable = {
|
||||||
tableStyle.width =
|
tableStyle.width =
|
||||||
typeof tableStyle.width === 'number' ? `${tableStyle.width}px` : tableStyle.width;
|
typeof tableStyle.width === 'number' ? `${tableStyle.width}px` : tableStyle.width;
|
||||||
}
|
}
|
||||||
|
if (fixed) {
|
||||||
|
const width = columns.reduce((sum, { width: w }) => {
|
||||||
|
return sum + parseFloat(w, 10);
|
||||||
|
}, 0);
|
||||||
|
if (width > 0) {
|
||||||
|
tableStyle.width = width + 'px';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const Table = hasBody ? components.table : 'table';
|
const Table = hasBody ? components.table : 'table';
|
||||||
const BodyWrapper = components.body.wrapper;
|
const BodyWrapper = components.body.wrapper;
|
||||||
|
@ -161,7 +169,7 @@ const BaseTable = {
|
||||||
if (hasBody) {
|
if (hasBody) {
|
||||||
body = <BodyWrapper class={`${prefixCls}-tbody`}>{this.renderRows(data, 0)}</BodyWrapper>;
|
body = <BodyWrapper class={`${prefixCls}-tbody`}>{this.renderRows(data, 0)}</BodyWrapper>;
|
||||||
}
|
}
|
||||||
const columns = this.getColumns();
|
|
||||||
return (
|
return (
|
||||||
<Table class={tableClassName} style={tableStyle} key="table">
|
<Table class={tableClassName} style={tableStyle} key="table">
|
||||||
<ColGroup columns={columns} fixed={fixed} />
|
<ColGroup columns={columns} fixed={fixed} />
|
||||||
|
|
Loading…
Reference in New Issue