WeChat applet error {"errMsg": "hideLoading:fail toast can't be found"}

{"errMsg": "hideLoading:fail toast can't be found"}

reason

wx.showToast()  和  wx.showLoading()

They are all hidden with wx. hideLoading ()

So if you use it together, you will get an error

Solution

1. Do not use together

2. Use wx.showToast after wx.hideLoading complete

wx.hideLoading({
  success: (response) => {
    // 成功
  },
  complete: response => {
    wx.showToast({
      title: '成功',
      icon:"none"
    })
  }
})

Guess you like

Origin blog.csdn.net/GrootBaby/article/details/129177285