fix: 解决treetable右侧出现空白的问题
This commit is contained in:
parent
1402f50d18
commit
41a51ce2d4
|
@ -410,6 +410,11 @@ var Table = function (_Component) {
|
|||
// this.bodyTable.scrollTop = nextProps.scrollTop;
|
||||
this.scrollTop = nextProps.scrollTop;
|
||||
}
|
||||
// fix:模态框中使用table,计算的滚动条宽度为0的bug
|
||||
// fix:表格首次渲染时 display:none,再显示时,未重新计算,导致表行出现错位的bug
|
||||
if (this.scrollbarWidth <= 0 && this.props.scroll.y) {
|
||||
this.scrollbarWidth = (0, _utils.measureScrollbar)();
|
||||
}
|
||||
if (!nextProps.originWidth) {
|
||||
this.computeTableWidth();
|
||||
this.firstDid = true; //避免重复update
|
||||
|
@ -417,11 +422,6 @@ var Table = function (_Component) {
|
|||
if (nextProps.resetScroll) {
|
||||
this.resetScrollX();
|
||||
}
|
||||
// fix:模态框中使用table,计算的滚动条宽度为0的bug
|
||||
// fix:表格首次渲染时 display:none,再显示时,未重新计算,导致表行出现错位的bug
|
||||
if (this.scrollbarWidth <= 0 && this.props.scroll.y) {
|
||||
this.scrollbarWidth = (0, _utils.measureScrollbar)();
|
||||
}
|
||||
|
||||
// console.log('this.scrollTop**********',this.scrollTop);
|
||||
};
|
||||
|
@ -694,7 +694,7 @@ var Table = function (_Component) {
|
|||
} else if (width) {
|
||||
width = parseInt(width);
|
||||
}
|
||||
if (lastShowIndex == i && width) {
|
||||
if (!column.fixed && lastShowIndex == i && width) {
|
||||
width = width + contentWidthDiff;
|
||||
}
|
||||
var cell = {
|
||||
|
|
|
@ -37447,6 +37447,11 @@
|
|||
// this.bodyTable.scrollTop = nextProps.scrollTop;
|
||||
this.scrollTop = nextProps.scrollTop;
|
||||
}
|
||||
// fix:模态框中使用table,计算的滚动条宽度为0的bug
|
||||
// fix:表格首次渲染时 display:none,再显示时,未重新计算,导致表行出现错位的bug
|
||||
if (this.scrollbarWidth <= 0 && this.props.scroll.y) {
|
||||
this.scrollbarWidth = (0, _utils.measureScrollbar)();
|
||||
}
|
||||
if (!nextProps.originWidth) {
|
||||
this.computeTableWidth();
|
||||
this.firstDid = true; //避免重复update
|
||||
|
@ -37454,11 +37459,6 @@
|
|||
if (nextProps.resetScroll) {
|
||||
this.resetScrollX();
|
||||
}
|
||||
// fix:模态框中使用table,计算的滚动条宽度为0的bug
|
||||
// fix:表格首次渲染时 display:none,再显示时,未重新计算,导致表行出现错位的bug
|
||||
if (this.scrollbarWidth <= 0 && this.props.scroll.y) {
|
||||
this.scrollbarWidth = (0, _utils.measureScrollbar)();
|
||||
}
|
||||
|
||||
// console.log('this.scrollTop**********',this.scrollTop);
|
||||
};
|
||||
|
@ -37731,7 +37731,7 @@
|
|||
} else if (width) {
|
||||
width = parseInt(width);
|
||||
}
|
||||
if (lastShowIndex == i && width) {
|
||||
if (!column.fixed && lastShowIndex == i && width) {
|
||||
width = width + contentWidthDiff;
|
||||
}
|
||||
var cell = {
|
||||
|
|
File diff suppressed because one or more lines are too long
12
src/Table.js
12
src/Table.js
|
@ -222,6 +222,11 @@ class Table extends Component {
|
|||
// this.bodyTable.scrollTop = nextProps.scrollTop;
|
||||
this.scrollTop = nextProps.scrollTop;
|
||||
}
|
||||
// fix:模态框中使用table,计算的滚动条宽度为0的bug
|
||||
// fix:表格首次渲染时 display:none,再显示时,未重新计算,导致表行出现错位的bug
|
||||
if(this.scrollbarWidth<=0 && this.props.scroll.y){
|
||||
this.scrollbarWidth = measureScrollbar();
|
||||
}
|
||||
if (!nextProps.originWidth) {
|
||||
this.computeTableWidth();
|
||||
this.firstDid = true;//避免重复update
|
||||
|
@ -229,11 +234,6 @@ class Table extends Component {
|
|||
if(nextProps.resetScroll){
|
||||
this.resetScrollX();
|
||||
}
|
||||
// fix:模态框中使用table,计算的滚动条宽度为0的bug
|
||||
// fix:表格首次渲染时 display:none,再显示时,未重新计算,导致表行出现错位的bug
|
||||
if(this.scrollbarWidth<=0 && this.props.scroll.y){
|
||||
this.scrollbarWidth = measureScrollbar();
|
||||
}
|
||||
|
||||
// console.log('this.scrollTop**********',this.scrollTop);
|
||||
|
||||
|
@ -500,7 +500,7 @@ class Table extends Component {
|
|||
} else if (width) {
|
||||
width = parseInt(width);
|
||||
}
|
||||
if (lastShowIndex == i && width) {
|
||||
if (!column.fixed && lastShowIndex == i && width) {
|
||||
width = width + contentWidthDiff;
|
||||
}
|
||||
const cell = {
|
||||
|
|
Loading…
Reference in New Issue