From 0e1398b5fffc82f6d610e24ba1527a2a22b168f3 Mon Sep 17 00:00:00 2001 From: jiangx Date: Thu, 28 Mar 2024 14:06:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 6 +++--- src/components/ScrollList/ScrollList.vue | 6 +++++- src/components/ScrollListItem/ScrollListItem.vue | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index fba7934..cd5dca9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@ diff --git a/src/components/ScrollList/ScrollList.vue b/src/components/ScrollList/ScrollList.vue index 4bc5565..0a8e390 100644 --- a/src/components/ScrollList/ScrollList.vue +++ b/src/components/ScrollList/ScrollList.vue @@ -56,8 +56,12 @@ function swiperInit(_swiper: any) { swiper.value = _swiper } +function scroll() { + swiper.value?.slideTo(0) +} + defineExpose({ - swiper + scroll }) diff --git a/src/components/ScrollListItem/ScrollListItem.vue b/src/components/ScrollListItem/ScrollListItem.vue index 4513b6b..eea82cd 100644 --- a/src/components/ScrollListItem/ScrollListItem.vue +++ b/src/components/ScrollListItem/ScrollListItem.vue @@ -15,7 +15,7 @@ {{ formatDate(customer.addTime) }} -
+