From ea89149d424e7eae747fce82a4b8169c59a7a380 Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:06:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(home):=20=E7=82=B9=E5=87=BB=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=85=A8=E5=B1=8F=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 clickSwipe 函数,使用 showImagePreview 方法实现全屏图片预览 - 在 van-swipe-item 中添加 @click 事件,传递图片索引给 clickSwipe 函数 --- app/pages/home/index.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/pages/home/index.vue b/app/pages/home/index.vue index 6e600cd..643f3f8 100644 --- a/app/pages/home/index.vue +++ b/app/pages/home/index.vue @@ -93,8 +93,11 @@ const images = [ 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/f7b65e23-ce21-41b4-8e58-9e6dc6950727.png', 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/41eceb23-d168-4049-ae8e-48c5328b192f.png', ]; -const clickSwipe=({target})=>{ - console.log('data',target.currentSrc) +const clickSwipe=(index)=>{ + showImagePreview({ + images: images, + startPosition:index, + }) } @@ -190,8 +193,8 @@ const clickSwipe=({target})=>{
- - + +