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

H5下 swiper circular无法关闭,默认设置或者直接设置circular为false都无法关闭 #6965

Closed
jerrylu0522 opened this issue Jul 8, 2020 · 4 comments
Assignees
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-2 Version - 2.x

Comments

@jerrylu0522
Copy link

相关平台

H5

浏览器版本: All
使用框架: React

复现步骤

问题出在:大神级的修改【fix: swiper init error #6674
1、创建一个 swiper 设置 circular为false,问题直接出现

期望结果

可关闭circular

实际结果

swiper无限循环衔接

环境信息

Taro CLI 2.2.10 environment info:
    System:
      OS: macOS 10.15.2
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 11.6.0 - /usr/local/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.14.5 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 2.2.10 => 2.2.10 
      @tarojs/components-qa: 2.2.10 => 2.2.10 
      @tarojs/mini-runner: 2.2.10 => 2.2.10 
      @tarojs/plugin-sass: 2.2.10 => 2.2.10 
      @tarojs/router: 2.2.10 => 2.2.10 
      @tarojs/taro: 2.2.10 => 2.2.10 
      @tarojs/taro-alipay: 2.2.10 => 2.2.10 
      @tarojs/taro-h5: 2.2.10 => 2.2.10 
      @tarojs/taro-qq: 2.2.10 => 2.2.10 
      @tarojs/taro-quickapp: 2.2.10 => 2.2.10 
      @tarojs/taro-rn: 2.2.10 => 2.2.10 
      @tarojs/taro-swan: 2.2.10 => 2.2.10 
      @tarojs/taro-tt: 2.2.10 => 2.2.10 
      @tarojs/taro-weapp: 2.2.10 => 2.2.10 
      @tarojs/webpack-runner: 2.2.10 => 2.2.10 
      eslint-config-taro: 2.2.10 => 2.2.10 
      eslint-plugin-taro: 2.2.10 => 2.2.10 
      nerv-devtools: ^1.5.7 => 1.5.7 
      nervjs: ^1.5.7 => 1.5.7 
      stylelint-config-taro-rn: 2.2.10 => 2.2.10 
      stylelint-taro-rn: 2.2.10 => 2.2.10 

补充信息

大神级的修改【fix: swiper init error #6674

应该修改为
`
componentDidUpdate (preProps) {
if (this.props.circular && preProps.children.length === 0 && this.props.children.length > 0) {
this.mySwiper.loopDestroy()
this.mySwiper.loopCreate()
}

`

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-2 Version - 2.x labels Jul 8, 2020
@justrustc
Copy link

+1

@justrustc
Copy link

unified with wechat swiper circular fix #6277 (#6326) (4b6cf4e)
是这个提交的问题吧

@ZakaryCode
Copy link
Contributor

unified with wechat swiper circular fix #6277 (#6326) (4b6cf4e)
是这个提交的问题吧

该调整是为了与小程序保持一致,circular 参数决定的并非是是否能够循环,而是循环发生时,实际的动画样式

@justrustc
Copy link

unified with wechat swiper circular fix #6277 (#6326) (4b6cf4e)
是这个提交的问题吧

该调整是为了与小程序保持一致,circular 参数决定的并非是是否能够循环,而是循环发生时,实际的动画样式

就是这个改动的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-2 Version - 2.x
Projects
Archived in project
Development

No branches or pull requests

3 participants