如何让小程序返回前显示信息?

小程序 文章 2022-02-24 12:00 415 0 全屏看文

AI助手支持GPT4.0

如何让小程序返回前显示信息?How to make the applet display information before returning?

如何让小程序返回前显示信息?
      wx.showToast({        title: '错误:' + this.initErrMsg,        icon: 'error',        duration: 3000,        success: function () {          wx.navigateBack({            complete: (res) => {              console.log("--初始化出错, 返回上一页")            },          })        }总是看不到提示信息, 马上就返回了.

      wx. Showtoast ({Title: 'error:' + this.initerrmsg, Icon: 'error', duration: 3000, success: function() {Wx. Navigateback ({complete: (RES) = > {console. Log ("-- initialization error, return to previous page")}, })} always can't see the prompt information, and immediately returned

回答:

再见,电脑崽:
wx.showToast({  title: '错误:' + this.initErrMsg,  icon: 'error',  duration: 3000,  success: function () {    setTimeout(function() {      wx.navigateBack({        complete: (res) => {          console.log("--初始化出错, 返回上一页")        }      })    }, 3000)  }})
null:

setTimeout

destiny:

延迟执行

brave:

什么意思?

-EOF-

AI助手支持GPT4.0