权限页面优化左右联动问题

This commit is contained in:
YeMingfei666 2025-07-01 11:38:26 +08:00
parent 7b1a084b5a
commit 98203617ea
1 changed files with 15 additions and 2 deletions

View File

@ -53,7 +53,7 @@
arr: [],
scrollRightTop: 0, // scroll-view
timer: null, //
isTabClickOver:true
}
},
onLoad() {
@ -92,6 +92,7 @@
await this.getMenuItemTop();
}
if (index == this.current) return;
this.isTabClickOver = false;
this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() {
this.scrollRightTop = this.arr[index];
@ -136,6 +137,9 @@
},
//
async leftMenuStatus(index) {
if (!this.isTabClickOver) {
return;
}
this.current = index;
// 0
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
@ -175,6 +179,10 @@
if (!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
if (e.detail.scrollTop == 0) {
this.isTabClickOver = true;
// return swichMenu(0)
}
setTimeout(() => { //
this.timer = null;
// scrollHeight
@ -184,7 +192,11 @@
let height2 = this.arr[i + 1];
// height2
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i);
if(this.isTabClickOver){
this.leftMenuStatus(i);
}else{
this.isTabClickOver = true;
}
return;
}
}
@ -265,6 +277,7 @@
.u-tab-view {
height: 100%;
background-color: #f6f6f6;
}
.right-box {