From 3a2ad8e278fae0fa68a7a4081733cf47a8b9d23b Mon Sep 17 00:00:00 2001 From: "jqtmviyu@gmail.com" Date: Thu, 25 Feb 2021 15:27:30 +0800 Subject: [PATCH] =?UTF-8?q?scroll-view=E8=A7=A3=E5=86=B3=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=BD=AE=E9=A1=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/category/category.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/category/category.vue b/src/pages/category/category.vue index 0b5026f..13352ba 100644 --- a/src/pages/category/category.vue +++ b/src/pages/category/category.vue @@ -12,7 +12,7 @@ {{item}} - + {{item.cat_name}} @@ -24,7 +24,7 @@ - + @@ -41,6 +41,8 @@ export default { menuCurrent: 0, // 右列表 goods: [], + // 滚动到顶部 + scrollTop: 0 } }, onLoad(){ @@ -60,10 +62,14 @@ export default { this.goods = message[this.menuCurrent].children // console.log(this.goods); }, + // 点击左菜单 onMenuTap(menuCurrent) { this.menuCurrent = menuCurrent this.goods = categoryData[menuCurrent].children + // 一直为0没变化, 小程序不会发现 + this.scrollTop = Math.random() / 1000; } + } }