From 544d9ebd4f5cd990f5776f571a67019ccb8e850e Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Wed, 8 Jan 2020 09:58:15 +0800 Subject: [PATCH] =?UTF-8?q?Table=20=E5=88=97=E5=9B=BA=E5=AE=9A=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Image.tsx | 1 - src/renderers/Table.tsx | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderers/Image.tsx b/src/renderers/Image.tsx index 34e4dd36b..83206914c 100644 --- a/src/renderers/Image.tsx +++ b/src/renderers/Image.tsx @@ -165,7 +165,6 @@ export class ImageField extends React.Component { placeholder, originalSrc, enlargeAble, - onEnlarge, showDimensions } = this.props; diff --git a/src/renderers/Table.tsx b/src/renderers/Table.tsx index f3d4069b4..3a9e7f15c 100644 --- a/src/renderers/Table.tsx +++ b/src/renderers/Table.tsx @@ -171,7 +171,7 @@ export default class Table extends React.Component { 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 { } } + componentDidUpdate() { + this.updateTableInfoLazy(); + } + componentWillUnmount() { const parent = this.parentNode; parent && parent.removeEventListener('scroll', this.affixDetect);