We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
浏览器版本: chrome87 使用框架: React
<Swiper> <SwiperItem> <View className='demo-text-1'>1</View> </SwiperItem> </Swiper>
按实际传的SwiperItem个数展示
前后各多了一个swiperItem,如上面的复现步骤上的代码,只传了一个,但实际上渲染出来会有三个。。。。
Taro v2.2.16 Taro CLI 2.2.16 environment info: System: OS: macOS 10.15.5 Shell: 3.2.57 - /bin/bash Binaries: Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm npmPackages: @tarojs/components: 2.2.16 => 2.2.16 @tarojs/mini-runner: ^2.2.16 => 2.2.16 @tarojs/plugin-babel: 2.2.16 => 2.2.16 @tarojs/plugin-csso: 2.2.16 => 2.2.16 @tarojs/plugin-sass: ^2.2.16 => 2.2.16 @tarojs/plugin-uglify: ^2.2.10 => 2.2.10 @tarojs/router: 2.2.16 => 2.2.16 @tarojs/taro: 2.2.16 => 2.2.16 @tarojs/taro-alipay: 2.2.16 => 2.2.16 @tarojs/taro-h5: 2.2.16 => 2.2.16 @tarojs/taro-qq: 2.2.16 => 2.2.16 @tarojs/taro-quickapp: 2.2.16 => 2.2.16 @tarojs/taro-swan: 2.2.16 => 2.2.16 @tarojs/taro-tt: 2.2.16 => 2.2.16 @tarojs/taro-weapp: 2.2.16 => 2.2.16 @tarojs/webpack-runner: 2.2.16 => 2.2.16 eslint-config-taro: 2.2.16 => 2.2.16 eslint-plugin-taro: 2.2.16 => 2.2.16 nerv-devtools: ^1.5.7 => 1.5.7 nervjs: ^1.5.7 => 1.5.7 stylelint-config-taro-rn: 2.2.16 => 2.2.16 stylelint-taro-rn: 2.2.16 => 2.2.16 taro-ui: ^2.2.4 => 2.3.4
看到源码是这样写的:
let items = [].concat(children) // 衔接滑动增加首尾 // if (circular) { if (items.length !== 0) { const firstItem = items[0] const lastItem = items[items.length - 1] items.push(firstItem) items.unshift(lastItem) }
单元测试上的case在验证swiperItem个数的时候也是多了2
swiperItem
The text was updated successfully, but these errors were encountered:
用来做无缝滚动的
Sorry, something went wrong.
@luckyadam 在设置了prevMargin,nextMargin的情况下,原本只写了一个SwiperItem,结果页面上会展示三个SwiperItem,这样跟原本的展示逻辑不符合诶!!而且在只有一个SwiperItem时不可以切换,现在有三个反而可以切换了,这也跟我们想要的效果不一样。
No branches or pull requests
相关平台
H5
浏览器版本: chrome87
使用框架: React
复现步骤
期望结果
按实际传的SwiperItem个数展示
实际结果
前后各多了一个swiperItem,如上面的复现步骤上的代码,只传了一个,但实际上渲染出来会有三个。。。。
环境信息
补充信息
看到源码是这样写的:
单元测试上的case在验证
swiperItem
个数的时候也是多了2The text was updated successfully, but these errors were encountered: