1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 微信小程序真机调试报错{“errMsg“:“hideLoading:fail:toast can‘t be found“}

微信小程序真机调试报错{“errMsg“:“hideLoading:fail:toast can‘t be found“}

时间:2022-08-11 05:43:24

相关推荐

微信小程序真机调试报错{“errMsg“:“hideLoading:fail:toast can‘t be found“}

真机调试时,遇到报错:

(in promise) MiniProgramError{"errMsg":"hideLoading:fail:toast can't be found"}Object

查看官方文档,发现报错原因可能是:

wx.showLoading 和 wx.showToast 同时只能显示一个wx.showLoading 应与 wx.hideLoading 配对使用

解决:

let loading = false //定义一个变量来判断是否loadingif(!loading){wx.showLoading({title: "加载中" });loading = true}if(loading){wx.hideLoading();loading = false}

智一面gtalent提供超多的web前端工程师小程序开发的笔试题

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。