最近在练习小程序,写了一个swiper的轮播功能,打算做成一个模块放在独立的文件夹中方便导入使用,但是出现了报错情况,代码以及报错情况如下,试过current:0,无效,缓存没有找到很好的办法写入。
轮播功能代码
轮播功能代码
<!--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>
楼主这个是怎么解决的,我的也是这个问题
楼主解决了吗 我也出现了相同问题
无发读取$$的属性。你搜一下,有没有$$这个,然后做个判断if(obj.$$){//在使用}。