From 721460bf42464beba6d98a438cb7e0015344ad47 Mon Sep 17 00:00:00 2001 From: yangchch6 Date: Thu, 5 Dec 2019 16:31:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BC=98=E5=8C=96=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=20ie11=20=E6=BB=9A=E5=8A=A8=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/Table.js | 11 +++++++---- src/Table.js | 12 +++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/build/Table.js b/build/Table.js index 93fd302..8f1346d 100644 --- a/build/Table.js +++ b/build/Table.js @@ -432,15 +432,18 @@ var Table = function (_Component) { if (this.scrollbarWidth <= 0 && this.props.scroll.y) { this.scrollbarWidth = (0, _utils.measureScrollbar)(); } + if (this.columnManager.isAnyColumnsFixed()) { + this.syncFixedTableRowHeight(); + } // console.log('this.scrollTop**********',this.scrollTop); }; Table.prototype.componentDidUpdate = function componentDidUpdate(prevProps) { - - if (this.columnManager.isAnyColumnsFixed()) { - this.syncFixedTableRowHeight(); - } + // fix: 挪到 componentWillReceiveProps 中处理,解决 ie11 滚动加载,导致浏览器崩溃的问题 + // if (this.columnManager.isAnyColumnsFixed()) { + // this.syncFixedTableRowHeight(); + // } //适应模态框中表格、以及父容器宽度变化的情况 if (typeof this.props.scroll.x !== 'number' && this.contentTable.getBoundingClientRect().width !== this.contentDomWidth && this.firstDid) { this.computeTableWidth(); diff --git a/src/Table.js b/src/Table.js index c25923b..90a83d4 100644 --- a/src/Table.js +++ b/src/Table.js @@ -233,17 +233,19 @@ class Table extends Component { if(this.scrollbarWidth<=0 && this.props.scroll.y){ this.scrollbarWidth = measureScrollbar(); } - + if (this.columnManager.isAnyColumnsFixed()) { + this.syncFixedTableRowHeight(); + } // console.log('this.scrollTop**********',this.scrollTop); } componentDidUpdate(prevProps) { - - if (this.columnManager.isAnyColumnsFixed()) { - this.syncFixedTableRowHeight(); - } + // fix: 挪到 componentWillReceiveProps 中处理,解决 ie11 滚动加载,导致浏览器崩溃的问题 + // if (this.columnManager.isAnyColumnsFixed()) { + // this.syncFixedTableRowHeight(); + // } //适应模态框中表格、以及父容器宽度变化的情况 if (typeof (this.props.scroll.x) !== 'number' && this.contentTable.getBoundingClientRect().width !== this.contentDomWidth && this.firstDid) { this.computeTableWidth();