原来是松松呀~ 2021-07-09 09:54 采纳率: 0%
浏览 1459

小程序报错Cannot read property '$$' of undefined

最近在练习小程序,写了一个swiper的轮播功能,打算做成一个模块放在独立的文件夹中方便导入使用,但是出现了报错情况,代码以及报错情况如下,试过current:0,无效,缓存没有找到很好的办法写入。
轮播功能代码

<view></view> 报错信息 [渲染层错误] TypeError: Cannot read property '$$' of undefined at HTMLElement._attached.o._touchstartHandlerForDevtools (http://127.0.0.1:21285/__pageframe__/__dev__/WAWebview.js?t=wechat&s=1625795366898&v=2.17.0:2:1085880)(env: Windows,mp,1.05.2105170; lib: 2.17.0) [渲染层错误] Uncaught TypeError: Cannot read property '$$' of undefined(env: Windows,mp,1.05.2105170; lib: 2.17.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>
    
    评论

报告相同问题?

问题事件

  • 创建了问题 7月9日