async previewImage(e) { // console.log(e) let index = e; let imgUrlList = await this.loadSwiper(this.storeId); co_uview 展开阅读更多用法">
赞
踩
<u-swiper :list="swiperList" img-mode="scaleToFill" height="400" @click="previewImage"></u-swiper>
async previewImage(e) { // console.log(e) let index = e; let imgUrlList = await this.loadSwiper(this.storeId); console.log('swiperList',this.swiperList) let list = imgUrlList.map((item,index) =>{ return item.image }) successs: (res)=>{ console.log(res) } console.log('list',list) uni.previewImage({ urls: list, current: index }) },
在html的组件代码中不必加上参数e,类似已一下@click=“previewImage(e)”,这样会报错,直接在方法中拿到e,e中封装好了回调参数
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。