微信小程序showToast后延迟跳转

在wx.showToast的success中调用setTimeout函数

wx.showToast({
    title: 'title',
    icon: 'none',
    duration: 2000,
    success: function () {
      setTimeout(function() {
        wx.navigateTo({
          url: '/pages/index/index',
        })
      }, 2000);
    }
});

  

posted @ 2021-04-10 15:29  路三千  阅读(397)  评论(0)    收藏  举报