收藏
回答

swiper的卡顿问题

问题模块 框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
API和组件 小程序 Bug swiper 工具 6.7.4 2.6.1

swiper 来回左右滑动,滑动7,8次,就会卡死,官方的demo也一样,也会卡死

最后一次编辑于  02-26  (未经腾讯允许,不得转载)
邀请回答
复制链接收藏投诉关注问题回答

2 个回答

  • 是柿子啊
    是柿子啊
    02-26

    swiper组件在持续优化中,感谢反馈

    02-26
    赞同
    回复 2
    • か不良人か
      か不良人か
      02-26

      17年就开始有人提,到现在还在优化,也是够可以的

      02-26
      回复
    • か不良人か
      か不良人か
      02-26回复か不良人か

      官方大佬,卡死是个很严重的问题啊

      02-26
      回复
  • 유미
    유미
    03-30



    郁闷啊,

    <swiper class="swiper" current="{{currentTab}}" duration="200" bindchange="swiperChange" bindanimationfinish="animationfinish">
            <swiper-item>
                <view id="fist-swiper-item">我是tab1---- index =1</view>
            </swiper-item>
            <swiper-item>
                <view>我是tab2---- index =2</view>
            </swiper-item>
            <swiper-item>
                <view>我是tab3---- index =3</view>
            </swiper-item>
            <swiper-item>
                <view>我是tab4---- index =4</view>
            </swiper-item>
            <swiper-item>
                <view>我是tab5----index = 5</view>
            </swiper-item>
        </swiper>
    // swiper 滑动切换
      swiperChange(e) {
        console.log(e.detail.current, 'e.detail.current', e.detail, 'e.detail~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
        console.log(this.data.currentTab, '原来 this.data.currentTab-swiperChange~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`')
        var that = this
        if (e.detail.source == 'touch') {
          if (e.detail.current == 0 && that.data.currentTab > 1) {
            that.setData({
              currentTab: that.data.currentTab
            })
          } else if (e.detail.current == 0 && that.data.currentTab == 1) {
            wx.createSelectorQuery().select('#fist-swiper-item').boundingClientRect(function (rect) {
              //rect.id // 节点的ID
              //rect.dataset // 节点的dataset
              //rect.left // 节点的左边界坐标
              console.log(rect.left)
            }).exec()
            console.log(e)
            that.setData({
              currentTab: e.detail.current
            })
          } else {
            that.setData({
              currentTab: e.detail.current
            })
          }
        }
      },


    03-30
    赞同
    回复