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在有设置tabbar的情况下宽度计算不对 #1071

Closed
Kaier33 opened this issue Nov 10, 2018 · 9 comments
Closed

swiper在有设置tabbar的情况下宽度计算不对 #1071

Kaier33 opened this issue Nov 10, 2018 · 9 comments

Comments

@Kaier33
Copy link

Kaier33 commented Nov 10, 2018

问题描述
swiper在有设置tabbar的情况下宽度计算不对. 不设置tabbar则没问题.

复现步骤
error
ok

期望行为
fix it

系统信息

  • 操作系统: [Windows 10]
  • Taro 版本 [ v.1.1.4]
  • Node.js 版本 [10.7]
  • 报错平台 [h5]
@jinjinjin0731
Copy link
Contributor

里面是个啥。。。 麻烦提供一个可复现的代码片段咯~

@Kaier33
Copy link
Author

Kaier33 commented Nov 10, 2018

里面是个啥。。。 麻烦提供一个可复现的代码片段咯~

用最新的版本init一个项目, 在app.js 设置例如:

   tabBar: {
      color: "#626567",
      selectedColor: "red",
      backgroundColor: "#FBFBFB",
      borderStyle: "#C7C2C6",
      list: [{
        pagePath: "pages/index/index",
        text: "发现",
      }, {
        pagePath: "pages/test/test",
        text: "视频",
      },
      ]
    }

然后在页面上. 复制进去文档中的swiper

    <Swiper
          className='test-h'
          indicatorColor='#999'
          indicatorActiveColor='#333'
          circular
          indicatorDots
          autoplay>
          <SwiperItem>
            <View className='demo-text-1'>1</View>
          </SwiperItem>
          <SwiperItem>
            <View className='demo-text-2'>2</View>
          </SwiperItem>
          <SwiperItem>
            <View className='demo-text-3'>3</View>
          </SwiperItem>
        </Swiper>

复现上述问题

@jinjinjin0731
Copy link
Contributor

样式呢。 样式文件有设置吗

@Kaier33
Copy link
Author

Kaier33 commented Nov 10, 2018

样式呢。 样式文件有设置吗

没做任何更改和新增.

我就是怕是自己的项目样式的问题,所以才init一个新的项目试验看看..结果还是那样;
补充: 如果手动切换一下tabBar再切回去,(或是触发更新数据触发 组件 更新), 那么swiper的宽度就OK了.. 可能是初始化的时候出了问题;

@jinjinjin0731
Copy link
Contributor

ok 我明天看一下。

@poorel
Copy link

poorel commented Nov 16, 2018

ok 我明天看一下。

补充:自然滚动会白屏,手动滚动之后再让其自然滚动 swiper会卡死

@zantop
Copy link

zantop commented Nov 20, 2018

同遇到了上述问题

1 similar comment
@q773592519
Copy link

同遇到了上述问题

@jinjinjin0731
Copy link
Contributor

已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants