|
@@ -381,8 +381,10 @@
|
|
|
},
|
|
|
|
|
|
updateScrollY() {
|
|
|
- this.layout.updateScrollY();
|
|
|
- this.layout.updateColumnsWidth();
|
|
|
+ const changed = this.layout.updateScrollY();
|
|
|
+ if (changed) {
|
|
|
+ this.layout.updateColumnsWidth();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
handleFixedMousewheel(event, data) {
|
|
@@ -408,7 +410,7 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- // TODO 性能优化
|
|
|
+ // TODO 使用 CSS transform
|
|
|
syncPostion: throttle(20, function() {
|
|
|
const { scrollLeft, scrollTop, offsetWidth, scrollWidth } = this.bodyWrapper;
|
|
|
const { headerWrapper, footerWrapper, fixedBodyWrapper, rightFixedBodyWrapper } = this.$refs;
|
|
@@ -464,10 +466,10 @@
|
|
|
},
|
|
|
|
|
|
doLayout() {
|
|
|
- this.layout.updateColumnsWidth();
|
|
|
if (this.shouldUpdateHeight) {
|
|
|
this.layout.updateElsHeight();
|
|
|
}
|
|
|
+ this.layout.updateColumnsWidth();
|
|
|
},
|
|
|
|
|
|
sort(prop, order) {
|
|
@@ -509,7 +511,7 @@
|
|
|
};
|
|
|
} else if (this.maxHeight) {
|
|
|
const maxHeight = parseHeight(this.maxHeight);
|
|
|
- if (maxHeight) {
|
|
|
+ if (typeof maxHeight === 'number') {
|
|
|
return {
|
|
|
'max-height': (maxHeight - footerHeight - (this.showHeader ? headerHeight : 0)) + 'px'
|
|
|
};
|
|
@@ -525,7 +527,7 @@
|
|
|
};
|
|
|
} else if (this.maxHeight) {
|
|
|
let maxHeight = parseHeight(this.maxHeight);
|
|
|
- if (maxHeight) {
|
|
|
+ if (typeof maxHeight === 'number') {
|
|
|
maxHeight = this.layout.scrollX ? maxHeight - this.layout.gutterWidth : maxHeight;
|
|
|
if (this.showHeader) {
|
|
|
maxHeight -= this.layout.headerHeight;
|
|
@@ -597,11 +599,6 @@
|
|
|
immediate: true,
|
|
|
handler(value) {
|
|
|
this.store.commit('setData', value);
|
|
|
- if (this.$ready) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.doLayout();
|
|
|
- });
|
|
|
- }
|
|
|
}
|
|
|
},
|
|
|
|