showLoading与showToast冲突
时间: 2023-10-20 22:29:25 浏览: 152
jquery.showLoading.js 百度云盘下载地址
showLoading与showToast之间存在冲突。当showLoading和showToast同时使用时,它们会相互覆盖对方,即showToast会隐藏showLoading,调用hideLoading时也会将toast内容进行隐藏。优先级是Toast> Loading,如果Toast正在显示,调用showLoading和hideLoading将无效。当调用showToast时,如果Loading正在显示,则会先调用wx.hideLoading隐藏Loading。为了解决这个冲突,可以使用setTimeout()方法异步队列调用,将showToast延迟一段时间后执行,以避免与showLoading冲突。例如,在代码中使用setTimeout方法异步调用showToast,可以解决冲突问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [教你解决showLoading 和 showToast显示异常的问题](https://blog.csdn.net/AP0906424/article/details/121556612)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [uniapp 之 解决uni.showToast和uni.showLoading、hideLoading的冲突问题](https://blog.csdn.net/weixin_45289067/article/details/126520902)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文