fix ivu-table-fixed bug
This commit is contained in:
parent
8744e122ee
commit
95e1720ce3
4 changed files with 15 additions and 3 deletions
|
@ -11,6 +11,12 @@
|
||||||
<div style='margin:20px 0px'>
|
<div style='margin:20px 0px'>
|
||||||
<Table :height='200' border :columns="columns2" :data="data3"></Table>
|
<Table :height='200' border :columns="columns2" :data="data3"></Table>
|
||||||
</div>
|
</div>
|
||||||
|
<div style='margin:20px 0px'>
|
||||||
|
<Table :width='500' border :columns="columns2" :data="data3"></Table>
|
||||||
|
</div>
|
||||||
|
<div style='margin:20px 0px'>
|
||||||
|
<Table :width='500' :height='200' border :columns="columns2" :data="data3"></Table>
|
||||||
|
</div>
|
||||||
<div style='margin:20px 0px;'>
|
<div style='margin:20px 0px;'>
|
||||||
<Table :data="tableData1" :columns="tableColumns1" :height='500' stripe size='small'></Table>
|
<Table :data="tableData1" :columns="tableColumns1" :height='500' stripe size='small'></Table>
|
||||||
<div style="margin: 10px;overflow: hidden">
|
<div style="margin: 10px;overflow: hidden">
|
||||||
|
|
|
@ -25,7 +25,10 @@ export default {
|
||||||
width = this.columnsWidth[column._index].width;
|
width = this.columnsWidth[column._index].width;
|
||||||
}
|
}
|
||||||
// when browser has scrollBar,set a width to resolve scroll position bug
|
// when browser has scrollBar,set a width to resolve scroll position bug
|
||||||
if (width && this.columns.length === index + 1 && top && this.$parent.bodyHeight !== 0) {
|
if(this.columns.length==7 && column.fixed){
|
||||||
|
console.log(column);
|
||||||
|
}
|
||||||
|
if (width && this.columns.length === index + 1 && top && this.$parent.bodyHeight !== 0 && column.fixed!=='left' && !this.fixed) {
|
||||||
let scrollBarWidth = this.$parent.scrollBarWidth;
|
let scrollBarWidth = this.$parent.scrollBarWidth;
|
||||||
if (!this.$parent.showVerticalScrollBar) scrollBarWidth = 0;
|
if (!this.$parent.showVerticalScrollBar) scrollBarWidth = 0;
|
||||||
width += scrollBarWidth;
|
width += scrollBarWidth;
|
||||||
|
|
|
@ -87,6 +87,9 @@
|
||||||
const style = Object.assign({}, this.styleObject);
|
const style = Object.assign({}, this.styleObject);
|
||||||
let scrollBarWidth = this.$parent.scrollBarWidth;
|
let scrollBarWidth = this.$parent.scrollBarWidth;
|
||||||
if(!this.$parent.showVerticalScrollBar) scrollBarWidth = 0;
|
if(!this.$parent.showVerticalScrollBar) scrollBarWidth = 0;
|
||||||
|
|
||||||
|
let isLeftFixed = this.$el && this.$el.parentElement.className.indexOf('fixed-header')>0;
|
||||||
|
if(isLeftFixed) scrollBarWidth = 0;
|
||||||
const width = this.$parent.bodyHeight === 0 ? parseInt(this.styleObject.width) : parseInt(this.styleObject.width) + scrollBarWidth;
|
const width = this.$parent.bodyHeight === 0 ? parseInt(this.styleObject.width) : parseInt(this.styleObject.width) + scrollBarWidth;
|
||||||
style.width = `${width}px`;
|
style.width = `${width}px`;
|
||||||
return style;
|
return style;
|
||||||
|
|
|
@ -314,7 +314,7 @@
|
||||||
if (col.fixed && col.fixed === 'left') {
|
if (col.fixed && col.fixed === 'left') {
|
||||||
left.push(col);
|
left.push(col);
|
||||||
} else {
|
} else {
|
||||||
other.push(col);
|
//other.push(col);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return left.concat(other);
|
return left.concat(other);
|
||||||
|
@ -326,7 +326,7 @@
|
||||||
if (col.fixed && col.fixed === 'right') {
|
if (col.fixed && col.fixed === 'right') {
|
||||||
right.push(col);
|
right.push(col);
|
||||||
} else {
|
} else {
|
||||||
other.push(col);
|
//other.push(col);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return right.concat(other);
|
return right.concat(other);
|
||||||
|
|
Loading…
Add table
Reference in a new issue