Skip to content

Commit 0310348

Browse files
author
黄书伟
committed
fixed bug
1 parent e7018b9 commit 0310348

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

packages/v-table/src/scroll-control-mixin.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import utils from '../../src/utils/utils.js'
66
export default {
77
methods: {
88
body1Mousewheel(e){
9+
910
var body2 = this.$el.querySelector('.v-table-rightview .v-table-body');
1011

1112
var e1 = e.originalEvent || window.event || e;
@@ -40,7 +41,13 @@ export default {
4041

4142
// 列表中滚动条控制
4243
scrollControl(){
43-
this.$nextTick(x => {
44+
45+
if (this.hasBindScrollEvent){return false;}
46+
47+
this.hasBindScrollEvent = true;
48+
49+
// 修复左侧固定列绑定滚动事件失效的问题
50+
setTimeout(x => {
4451

4552
var body1 = this.$el.querySelector('.v-table-leftview .v-table-body');
4653
var body2 = this.$el.querySelector('.v-table-rightview .v-table-body');

packages/v-table/src/table-resize-mixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export default {
126126
if (self.isVerticalResize && currentHeight > 0) {
127127
// (窗口高度缩小 && 当前高度大于最小高度) || (窗口高度扩大 && 当前高度小于最大高度)
128128
bottom -= self.verticalResizeOffset;
129-
if ((bottom < 0 && currentHeight > minHeight) || (bottom > 0 && currentHeight < maxHeight)) {
129+
if ((currentHeight > minHeight) || (currentHeight < maxHeight)) {
130130
var currentHeight = currentHeight + bottom;// - self.VerticalResizeOffset;
131131
currentHeight = currentHeight > maxHeight ? maxHeight : currentHeight;
132132
currentHeight = currentHeight < minHeight ? minHeight : currentHeight;

packages/v-table/src/table.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,6 @@
806806
if (Array.isArray(this.tableData) && this.tableData.length > 0) {
807807
808808
this.scrollControl();
809-
this.hasBindScrollEvent = true;
810809
}
811810
812811
this.singelSortInit();
@@ -843,13 +842,16 @@
843842
844843
this.tableEmpty();
845844
845+
if (this.isTableEmpty){
846+
847+
this.hasBindScrollEvent = false;
848+
}
849+
846850
if (Array.isArray(newVal) && newVal.length > 0) {
847851
848852
this.initView();
849853
850-
if (!this.hasBindScrollEvent) {
851-
this.scrollControl();
852-
}
854+
this.scrollControl();
853855
}
854856
855857
this.resize();

0 commit comments

Comments
 (0)