Applets card swiper dead

Applets swiper slide stuck problem

The reason may be swiper components of internal problems, when you can not respond to user actions quickly flip the current variable current page can not be changed to the correct page references, but is set to 0,
    console.log(e.detail.current);
    if (e.detail.source == "touch") {
      //防止swiper控件卡死
      if (this.data.current == 0 && this.data.dailySpikeIndex > 1) {//卡死时,重置current为正确索引
        this.setData({ dailySpikeIndex: this.data.dailySpikeIndex });
      }
      else {//正常轮转时,记录正确页码索引
        this.setData({ dailySpikeIndex: e.detail.current });
      }
    }
  },

Guess you like

Origin blog.csdn.net/weixin_33853794/article/details/91032023