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组件定位异常 #1687

Closed
dsky1990 opened this issue Dec 25, 2018 · 8 comments
Closed

swiper组件定位异常 #1687

dsky1990 opened this issue Dec 25, 2018 · 8 comments
Assignees

Comments

@dsky1990
Copy link

问题描述
swiper组件定位异常
image

<section className="banner_index">
          <Swiper
          className='swiper'
          indicatorColor='#999'
          indicatorActiveColor='#333'
          circular
          indicatorDots
          slideToLoop='500'
          >
          <SwiperItem>
          <Image className='index_swiper' src={bannerImg} onLoad={this.imgLoad}/>
          </SwiperItem>
          <SwiperItem>
          <Image className='index_swiper' src={bannerImg2} onLoad={this.imgLoad}/>
          </SwiperItem>
          <SwiperItem>
          <Image className='index_swiper' src={bannerImg3} onLoad={this.imgLoad}/>
          </SwiperItem>
        </Swiper>
        </section>

系统信息

  • 报错平台 [h5]
👽 Taro v1.2.1


  Taro CLI 1.2.1 environment info:
    System:
      OS: macOS 10.14.2
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.12.0 - /usr/local/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
    npmPackages:
      @tarojs/async-await: ^1.2.1 => 1.2.1
      @tarojs/components: ^1.2.1 => 1.2.1
      @tarojs/plugin-babel: ^1.2.1 => 1.2.1
      @tarojs/plugin-csso: ^1.2.1 => 1.2.1
      @tarojs/plugin-sass: ^1.2.1 => 1.2.1
      @tarojs/plugin-uglifyjs: ^1.2.1 => 1.2.1
      @tarojs/redux: ^1.2.1 => 1.2.1
      @tarojs/redux-h5: ^1.2.1 => 1.2.1
      @tarojs/router: ^1.2.1 => 1.2.1
      @tarojs/taro: ^1.2.1 => 1.2.1
      @tarojs/taro-alipay: ^1.2.1 => 1.2.1
      @tarojs/taro-h5: ^1.2.1 => 1.2.1
      @tarojs/taro-swan: ^1.2.1 => 1.2.1
      @tarojs/taro-weapp: ^1.2.1 => 1.2.1
      @tarojs/webpack-runner: ^1.2.1 => 1.2.1
      eslint-config-taro: ^1.2.1 => 1.2.1
      eslint-plugin-taro: ^1.2.1 => 1.2.1
    npmGlobalPackages:
      typescript: 3.1.6
@taro-bot
Copy link

taro-bot bot commented Dec 25, 2018

欢迎提交 Issue~

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

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

Good luck and happy coding~

@jinjinjin0731
Copy link
Contributor

嗯…你是刷新页面,还是初始化页面出现的?

@dsky1990
Copy link
Author

@jinjinjin0731 初始化和刷新都会 - -,但是点了这个后就好了- -
image
但是刷新还是会

@dsky1990
Copy link
Author

image
而且这个地方为啥会把代码插入到标签内部

@dsky1990
Copy link
Author

好像重绘一次就行了,我现在的解决办法是

setTimeout(() => {
      document.querySelector('.swiper-container').classList.remove('swiper')
    }, 100)

image

@taro-bot
Copy link

taro-bot bot commented Dec 26, 2018

CC @jinjinjin0731

@jinjinjin0731
Copy link
Contributor

你用chrome 调试模式也会吗。 我这边用你代码没有复现。 可以给个稳定复现的方式吗

@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

3 participants