From 1d48c178c19b19cb8c03679cd0fd6d3a4f58efc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com> Date: Thu, 9 Mar 2023 03:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cate/cate.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/cate/cate.vue b/src/components/cate/cate.vue index 12445c6..133670b 100644 --- a/src/components/cate/cate.vue +++ b/src/components/cate/cate.vue @@ -155,9 +155,11 @@ export default { * 更新左侧菜单 */ updateMenuStatus(index) { + if (index != this.currentLeftIndex) { + this.$emit("onScroll", this.data[index].id); + } this.currentLeftIndex = index; this.scrollLeftTop = index * this.menuHeight - this.wrapHeight / 2; - this.$emit("onScroll", this.data[index].id); }, /** * 滚动监听