feat:优化表格更新处理逻辑,解决 ie11 滚动加载,导致浏览器崩溃的问题
This commit is contained in:
parent
80b0bf7dd4
commit
721460bf42
|
@ -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();
|
||||
|
|
12
src/Table.js
12
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();
|
||||
|
|
Loading…
Reference in New Issue