This commit is contained in:
wanghaoo 2018-10-24 21:59:54 +08:00
parent 059414bfae
commit a6adc2be0d
2 changed files with 5 additions and 4 deletions

View File

@ -126,6 +126,7 @@ var defaultProps = {
emptyText: function emptyText() {
return 'No Data';
},
columns: [],
minColumnWidth: 80
};
@ -235,9 +236,9 @@ var Table = function (_Component) {
}
if (nextProps.columns && nextProps.columns !== this.props.columns) {
this.columnManager.reset(nextProps.columns);
if (this.refs && this.refs.bodyTable) {
//如果列变了对应的table的ScrollTop属性置为0
this.refs.bodyTable.scrollTop = 0;
if (nextProps.columns.length !== this.props.length && this.refs && this.refs.bodyTable) {
this.refs.fixedColumnsBodyLeft && (this.refs.fixedColumnsBodyLeft.scrollTop = this.refs.bodyTable.scrollTop);
this.refs.fixedColumnsBodyRight && (this.refs.fixedColumnsBodyRight.scrollTop = this.refs.bodyTable.scrollTop);
}
} else if (nextProps.children !== this.props.children) {
this.columnManager.reset(null, nextProps.children);

View File

@ -1,6 +1,6 @@
{
"name": "bee-table",
"version": "1.4.24",
"version": "1.4.25",
"description": "Table ui component for react",
"keywords": [
"react",