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问题 #1528

Closed
SmallRuralDog opened this issue Dec 15, 2018 · 2 comments
Closed

H5 Swiper问题 #1528

SmallRuralDog opened this issue Dec 15, 2018 · 2 comments
Assignees

Comments

@SmallRuralDog
Copy link
Contributor

问题描述
tabbar设置了两个页面/pages/index /pages/user
/pages/index下有Swiper,高度设置为30px
打开/pages/indexSwiper高度正常。
先打开 /pages/user,然后点击tabbar切换到/pages/index .Swiper高度为150px。

代码
先打开/pages/index的代码
image

先打开/pages/user再切换到/pages/index的代码
image

render() {

    const Content = this.props.notificationList && this.props.notificationList.length > 0 ? this.props.notificationList.map(item => {
      return <SwiperItem><Text>{item}</Text></SwiperItem>
    }) : ''
    return <View className='notification-view'>
      <AtIcon prefixClass={'iconfont'} value={'laba'} size='22' />
      <Swiper
        vertical
        autoplay
        interval={1500}
        className='swiper'>
        {Content}
      </Swiper>
    </View>
  }
$height:60px;
.swiper{
    flex: 1;
    height: $height;
    .swiper-slide{
      height: $height;
      display: flex;
      align-items: center;
      .taro-text{
        font-size: 28px;
        word-break:keep-all;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
      }
    }
  }

系统信息

  • 操作系统: [ Windows 10]
  • Taro 版本 [1.2.0-beta.15]
  • Node.js 版本 [ v8.9.4]
  • 报错平台 [h5]
@taro-bot
Copy link

taro-bot bot commented Dec 15, 2018

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@taro-bot
Copy link

taro-bot bot commented Dec 17, 2018

CC @jinjinjin0731

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

3 participants