Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

嵌套的swiper无法正常渲染 #7692

Closed
Clear2 opened this issue Sep 22, 2020 · 5 comments · Fixed by #7971
Closed

嵌套的swiper无法正常渲染 #7692

Clear2 opened this issue Sep 22, 2020 · 5 comments · Fixed by #7971
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@Clear2
Copy link

Clear2 commented Sep 22, 2020

相关平台

微信小程序

复现仓库

https://github.com/Clear2/taro-reports
小程序基础库: 2.10.2
使用框架: React

复现步骤

   <Swiper>
      <SwiperItem>
        111111
        <Swiper>
          <SwiperItem>demo-1---1111</SwiperItem>
          <SwiperItem>demo-1---2222</SwiperItem>
        </Swiper>
      </SwiperItem>
      <SwiperItem>
        22222
        <Swiper>
          <SwiperItem>demo -2-----2223333</SwiperItem>
          <SwiperItem>demo -2-----222</SwiperItem>
        </Swiper>
      </SwiperItem>
    </Swiper>

期望结果

swiper-item 里的嵌套的 swiper组件正常渲染出来

实际结果

swiper-item 里的swiper组件没有渲染出来

环境信息

  Taro CLI 3.0.10 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.16.2 - ~/.nvm/versions/node/v12.16.2/bin/node
      Yarn: 1.22.4 - ~/.nvm/versions/node/v12.16.2/bin/yarn
      npm: 6.14.4 - ~/.nvm/versions/node/v12.16.2/bin/npm

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Sep 22, 2020
@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 22, 2020

业务会存在这种情况吗,不支持递归 template 调用的小程序(wx、qq、jd)目前默认 Swiper 不允许调用自身。

@SyMind
Copy link
Member

SyMind commented Sep 22, 2020

@Chen-jj 小程序本身支持的功能我想不该被限制吧。

@pangnate
Copy link

业务会存在此情况,目前小程序做视频或者直播的业务都比较多,类似快手短视频、爱逛小程序。场景是左右滑动首页、上下滑动列表。是否可以考虑支持3层以内的嵌套 @Chen-jj

@kzk1353
Copy link

kzk1353 commented Nov 10, 2020

@Chen-jj 你确定修复了?
我新开一个项目测试都报错
以前用组件隔开的话没问题, 现在反而报同一错误

[渲染层错误] TypeError: Cannot read property '$$' of undefined
at HTMLElement._attached.d._touchstartHandlerForDevtools (http://127.0.0.1:24130/__pageframe__/__dev__/WAWebview.js:2:1305093)
[渲染层错误] SystemError (webviewScriptError)
Cannot read property '$$' of undefined
TypeError: Cannot read property '$$' of undefined
at HTMLElement._attached.d._touchstartHandlerForDevtools (http://127.0.0.1:24130/__pageframe__/__dev__/WAWebview.js:2:1305093)
[渲染层错误] Uncaught

@402931261
Copy link

@Chen-jj 你确定修复了? 我新开一个项目测试都报错 以前用组件隔开的话没问题, 现在反而报同一错误

[渲染层错误] TypeError: Cannot read property '$$' of undefined at HTMLElement._attached.d._touchstartHandlerForDevtools (http://127.0.0.1:24130/__pageframe__/__dev__/WAWebview.js:2:1305093) [渲染层错误] SystemError (webviewScriptError) Cannot read property '$$' of undefined TypeError: Cannot read property '$$' of undefined at HTMLElement._attached.d._touchstartHandlerForDevtools (http://127.0.0.1:24130/__pageframe__/__dev__/WAWebview.js:2:1305093) [渲染层错误] Uncaught

我也遇到了你这个报错,但是不是因为嵌套引起的,就是普通的swiper和swiper-item这样,然后swiper-item在小程序里面看到的是view就很奇怪了 @Chen-jj 请问这个问题需要怎么解决呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants