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 使用circular 为true时,swiper第一次显示时闪烁了一下 #14487

Closed
laoriy opened this issue Sep 5, 2023 · 5 comments · Fixed by #14558, #14582 or #14586
Closed

swiper 使用circular 为true时,swiper第一次显示时闪烁了一下 #14487

laoriy opened this issue Sep 5, 2023 · 5 comments · Fixed by #14558, #14582 or #14586
Labels
A-components Area - H5 组件库相关 E-medium Helper Wanted - Medium F-vue3 Framework - Vue 3 T-h5 Target - 编译到 H5 V-3 Version - 3.x
Milestone

Comments

@laoriy
Copy link

laoriy commented Sep 5, 2023

相关平台

H5

浏览器版本: Chrome版本 116.0.5845.111
使用框架: Vue 3

复现步骤

使用h5的模板,vue页面添加如下内容

<swiper style="height: 100px;width: 100%;"   :circular="true">
        <swiper-item>1111少时诵诗书所所所所1111少时诵诗书所所所所1111少时诵诗书所所所所1111少时诵诗书所所所所1111少时诵诗书所所所所1111少时诵诗书所所所所1111少时诵诗书所所所所</swiper-item>
        <swiper-item>22大大大222大大大222大大大222大大大222大大大222大大大222大大大222大大大222大大大222大大大222大大大222大大大222大大大222大大大222大大大2</swiper-item>
        <swiper-item>33333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法333333333的方法3</swiper-item>
    </swiper>

期望结果

能直接正常展示第一个swiper-item内容

实际结果

先闪一下第二个swiper-item内容,然后迅速显示为第一个swiper-item的内容。能看到闪的过程

环境信息

 Taro CLI 3.6.14 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 14.19.0 - C:\Program Files\nodejs\node.EXE 
      npm: 6.14.16 - C:\Program Files\nodejs\npm.CMD   
    npmPackages:
      @tarojs/cli: 3.6.14 => 3.6.14 
      @tarojs/components: 3.6.14 => 3.6.14 
      @tarojs/helper: 3.6.14 => 3.6.14 
      @tarojs/plugin-framework-vue3: 3.6.14 => 3.6.14  
      @tarojs/plugin-platform-alipay: 3.6.14 => 3.6.14 
      @tarojs/plugin-platform-h5: 3.6.14 => 3.6.14
      @tarojs/plugin-platform-jd: 3.6.14 => 3.6.14
      @tarojs/plugin-platform-qq: 3.6.14 => 3.6.14
      @tarojs/plugin-platform-swan: 3.6.14 => 3.6.14
      @tarojs/plugin-platform-tt: 3.6.14 => 3.6.14
      @tarojs/plugin-platform-weapp: 3.6.14 => 3.6.14
      @tarojs/runtime: 3.6.14 => 3.6.14
      @tarojs/shared: 3.6.14 => 3.6.14
      @tarojs/taro: 3.6.14 => 3.6.14
      @tarojs/taro-loader:      => 3.6.14
      @tarojs/webpack5-runner: 3.6.14 => 3.6.14
      babel-preset-taro: 3.6.14 => 3.6.14
      eslint-config-taro: 3.6.14 => 3.6.14
@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Sep 5, 2023
@laoriy
Copy link
Author

laoriy commented Sep 5, 2023

image
这一帧是在渲染第一个swiper-item内容先渲染的

@ZakaryCode
Copy link
Contributor

可以先验证 3.6.15 是否满足预期

@laoriy
Copy link
Author

laoriy commented Sep 6, 2023

可以先验证 3.6.15 是否满足预期

问题同样存在

Video_2023-09-06_102338.mp4

@ZakaryCode ZakaryCode added A-components Area - H5 组件库相关 E-medium Helper Wanted - Medium labels Sep 6, 2023
@TheKonka
Copy link
Member

componentDidRender里面 handleSwiperLoop 函数加了 debounce 的原因,没有立即调用

@ZakaryCode
Copy link
Contributor

componentDidRender里面 handleSwiperLoop 函数加了 debounce 的原因,没有立即调用

确实,我提个 PR 改改

@ZakaryCode ZakaryCode added this to the 3.6.17 milestone Sep 15, 2023
ZakaryCode added a commit that referenced this issue Sep 15, 2023
* fix(h5): swiper loop handle immediately #14487

* fix(test): stencil test error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-components Area - H5 组件库相关 E-medium Helper Wanted - Medium F-vue3 Framework - Vue 3 T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
3 participants