最近在练习小程序,写了一个swiper的轮播功能,打算做成一个模块放在独立的文件夹中方便导入使用,但是出现了报错情况,代码以及报错情况如下,试过current:0,无效,缓存没有找到很好的办法写入。
轮播功能代码
小程序报错Cannot read property '$$' of undefined
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
4条回答 默认 最新
原来是松松呀~ 2021-07-09 09:55关注轮播功能代码
<!--modules/carousel/carousel.wxml--> <template name="carousel"> <view> <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> <block wx:for="{{imgUrls}}" wx:key="key"> <swiper-item> <image src="{{item}}" style="width:100%"/> </swiper-item> </block> </swiper> </view> </template>评论 打赏 举报解决 1无用