Table 列固定更新问题优化

This commit is contained in:
2betop 2020-01-08 09:58:15 +08:00
parent 46c9c54116
commit 544d9ebd4f
2 changed files with 5 additions and 2 deletions

View File

@ -165,7 +165,6 @@ export class ImageField extends React.Component<ImageFieldProps, object> {
placeholder,
originalSrc,
enlargeAble,
onEnlarge,
showDimensions
} = this.props;

View File

@ -171,7 +171,7 @@ export default class Table extends React.Component<TableProps, object> {
this.affixDetect = this.affixDetect.bind(this);
this.updateTableInfoLazy = debounce(this.updateTableInfo.bind(this), 250, {
trailing: true,
leading: false
leading: true
});
this.tableRef = this.tableRef.bind(this);
this.affixedTableRef = this.affixedTableRef.bind(this);
@ -341,6 +341,10 @@ export default class Table extends React.Component<TableProps, object> {
}
}
componentDidUpdate() {
this.updateTableInfoLazy();
}
componentWillUnmount() {
const parent = this.parentNode;
parent && parent.removeEventListener('scroll', this.affixDetect);