真机调试时,遇到报错:
(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前端工程师小程序开发的笔试题