diff --git a/pages/shop/list.vue b/pages/shop/list.vue index d0af915..196b56b 100644 --- a/pages/shop/list.vue +++ b/pages/shop/list.vue @@ -114,6 +114,8 @@ arr: [], //记录 右边菜单每个item到顶部的距离 scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 timer: null, // 定时器 + + isScrollingByClick: false, // 添加这个标志 解决点击左侧导航栏点击 右侧内容滚动之后 反过来影响左侧导致跳变 } }, onReady() { @@ -171,7 +173,7 @@ } if (index == this.current) return this.scrollRightTop = this.oldScrollTop - this.$nextTick(function() { + this.$nextTick(() => { this.scrollRightTop = this.arr[index] this.current = index this.leftMenuStatus(index) @@ -263,7 +265,7 @@ // 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可 if (!height2 || scrollHeight >= height1 && scrollHeight < height2) { this.leftMenuStatus(i) - return + console.log('hi') } } }, 10)