Commit 1c1a2fe3 by limin

修改竖向滚动条不显示的问题

1 parent 426ac284
...@@ -522,48 +522,6 @@ export default { ...@@ -522,48 +522,6 @@ export default {
} }
}), }),
// begin add limin
// 这个方法是当el-table设置max-height时,el-scroll height:100%失效,导致el-scroll-wrap的margin-right失效,所以给el-scroll设置height为max-height的高度
bodyScrollHeight() {
const { headerHeight = 0, footerHeight = 0 } = this.layout;
if (this.maxHeight) {
const maxHeight = parseHeight(this.maxHeight);
if (typeof maxHeight === "number") {
return {
height:
maxHeight -
footerHeight -
(this.showHeader ? headerHeight : 0) +
"px",
};
}
}
return { height: "100%" };
},
// 这个方法就用到了scrollbarWidth,当el-table设置height为固定高度时,el-scroll-wrap的100%和固定高度一样,导致margin-bottom失效,这里直接把el-scroll-wrap的高度算好,是el-table固定高度加上滚动条宽度
bodyScrollWrapHeight() {
const { headerHeight = 0, bodyHeight, footerHeight = 0 } = this.layout;
if (this.height) {
return {
height: bodyHeight ? bodyHeight + scrollbarWidth() + "px" : "",
};
} else if (this.maxHeight) {
const maxHeight = parseHeight(this.maxHeight);
if (typeof maxHeight === "number") {
return {
height:
maxHeight -
footerHeight -
(this.showHeader ? headerHeight : 0) +
scrollbarWidth() +
"px",
};
}
}
return {};
},
// end add limin
bindEvents() { bindEvents() {
this.bodyWrapper.addEventListener("scroll", this.syncPostion, { this.bodyWrapper.addEventListener("scroll", this.syncPostion, {
passive: true, passive: true,
...@@ -750,6 +708,48 @@ export default { ...@@ -750,6 +708,48 @@ export default {
}, },
// end add limin // end add limin
// begin add limin
// 这个方法是当el-table设置max-height时,el-scroll height:100%失效,导致el-scroll-wrap的margin-right失效,所以给el-scroll设置height为max-height的高度
bodyScrollHeight() {
const { headerHeight = 0, footerHeight = 0 } = this.layout;
if (this.maxHeight) {
const maxHeight = parseHeight(this.maxHeight);
if (typeof maxHeight === "number") {
return {
height:
maxHeight -
footerHeight -
(this.showHeader ? headerHeight : 0) +
"px",
};
}
}
return { height: "100%" };
},
// 这个方法就用到了scrollbarWidth,当el-table设置height为固定高度时,el-scroll-wrap的100%和固定高度一样,导致margin-bottom失效,这里直接把el-scroll-wrap的高度算好,是el-table固定高度加上滚动条宽度
bodyScrollWrapHeight() {
const { headerHeight = 0, bodyHeight, footerHeight = 0 } = this.layout;
if (this.height) {
return {
height: bodyHeight ? bodyHeight + scrollbarWidth() + "px" : "",
};
} else if (this.maxHeight) {
const maxHeight = parseHeight(this.maxHeight);
if (typeof maxHeight === "number") {
return {
height:
maxHeight -
footerHeight -
(this.showHeader ? headerHeight : 0) +
scrollbarWidth() +
"px",
};
}
}
return {};
},
// end add limin
...mapStates({ ...mapStates({
selection: "selection", selection: "selection",
columns: "columns", columns: "columns",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!