From 44295ea08d52394ba7b1945b820ee865eb6b0ee5 Mon Sep 17 00:00:00 2001 From: yeyuqiudeng Date: Wed, 18 Dec 2019 17:41:03 +0800 Subject: [PATCH] =?UTF-8?q?fix=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Table.tsx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/renderers/Table.tsx b/src/renderers/Table.tsx index a8904132..71114e59 100644 --- a/src/renderers/Table.tsx +++ b/src/renderers/Table.tsx @@ -173,7 +173,7 @@ export default class Table extends React.Component { leading: false }); this.tableRef = this.tableRef.bind(this); - this.affxiedTableRef = this.affxiedTableRef.bind(this); + this.affixedTableRef = this.affixedTableRef.bind(this); this.handleAction = this.handleAction.bind(this); this.handleCheck = this.handleCheck.bind(this); this.handleCheckAll = this.handleCheckAll.bind(this); @@ -519,12 +519,14 @@ export default class Table extends React.Component { const clip = (this.table as HTMLElement).getBoundingClientRect(); const offsetY = this.props.env.affixOffsetTop || 0; const affixed = clip.top < offsetY && clip.top + clip.height - 40 > offsetY; - const afixedDom = dom.querySelector(`.${ns}Table-fixedTop`) as HTMLElement; + const affixedDom = dom.querySelector(`.${ns}Table-fixedTop`) as HTMLElement; - afixedDom.style.cssText += `top: ${offsetY}px;width: ${ + affixedDom.style.cssText += `top: ${offsetY}px;width: ${ (this.table.parentNode as HTMLElement).offsetWidth }px`; - affixed ? afixedDom.classList.add('in') : afixedDom.classList.remove('in'); + affixed + ? affixedDom.classList.add('in') + : affixedDom.classList.remove('in'); // store.markHeaderAffix(clip.top < offsetY && (clip.top + clip.height - 40) > offsetY); } @@ -688,7 +690,7 @@ export default class Table extends React.Component { this.dragTip = ref; } - affxiedTableRef(ref: HTMLTableElement) { + affixedTableRef(ref: HTMLTableElement) { this.affixedTable = ref; } @@ -1201,7 +1203,7 @@ export default class Table extends React.Component { {this.renderHeader(false)}
{store.leftFixedColumns.length - ? this.renderFxiedColumns( + ? this.renderFixedColumns( store.leftFixedColumns, true, tableClassName @@ -1210,7 +1212,7 @@ export default class Table extends React.Component {
{store.rightFixedColumns.length - ? this.renderFxiedColumns( + ? this.renderFixedColumns( store.rightFixedColumns, true, tableClassName @@ -1218,7 +1220,7 @@ export default class Table extends React.Component { : null}
- +
{store.columnGroup.length ? ( @@ -1248,7 +1250,7 @@ export default class Table extends React.Component { ) : null; } - renderFxiedColumns( + renderFixedColumns( columns: Array, headerOnly: boolean = false, tableClassName: string = '' @@ -1801,7 +1803,7 @@ export default class Table extends React.Component { >
{store.leftFixedColumns.length - ? this.renderFxiedColumns( + ? this.renderFixedColumns( store.leftFixedColumns, false, tableClassName @@ -1810,7 +1812,7 @@ export default class Table extends React.Component {
{store.rightFixedColumns.length - ? this.renderFxiedColumns( + ? this.renderFixedColumns( store.rightFixedColumns, false, tableClassName