【类 型】:fix

【主	题】:导航栏bug
【描	述】:
	[原因]:每次点击导航栏  右侧内容栏滚动 反向导致 导航栏乱跳bug
	[过程]:点击时加个标记 定时删除标记
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-06-13 17:03:30 +08:00
parent d2c0364cbf
commit dd243e84da

View File

@ -116,6 +116,7 @@
timer: null, //
isScrollingByClick: false, //
scrollingTiemout: null, //timeout
}
},
onReady() {
@ -168,16 +169,21 @@
totalPrice,
//
async swichMenu(index) {
clearTimeout(this.scrollingTiemout) //timeout
this.isScrollingByClick = true
if (this.arr.length == 0) {
await this.getMenuItemTop()
}
if (index == this.current) return
this.scrollRightTop = this.oldScrollTop
this.$nextTick(() => {
this.$nextTick(function() {
this.scrollRightTop = this.arr[index]
this.current = index
this.leftMenuStatus(index)
})
this.scrollingTiemout = setTimeout(() => {
this.isScrollingByClick = false
}, 800)
},
//
getElRect(elClass, dataVal) {
@ -264,8 +270,10 @@
let height2 = this.arr[i + 1]
// height2
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i)
console.log('hi')
if (!this.isScrollingByClick) {
this.leftMenuStatus(i)
}
return
}
}
}, 10)