showModal无法关闭
时间: 2023-10-14 17:05:14 浏览: 142
根据引用中的代码片段,showModal方法无法关闭的问题可以通过重置showModal方法来解决。在代码中,通过重新定义showModal方法的实现,将cancelText和confirmText的默认值进行交换,以达到取消和确定按钮的交换位置的效果。这样,在调用showModal方法时,点击确定按钮将执行cancel方法,点击取消按钮将执行confirm方法。因此,通过重置showModal方法,可以实现关闭showModal的功能。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* [uniapp的uni.showModal在app上重写让确定、取消换位置](https://blog.csdn.net/m0_46099649/article/details/127262101)[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_1"}}] [.reference_item style="max-width: 50%"]
- *2* [浅析微信小程序modal弹窗关闭默认会执行cancel问题](https://download.csdn.net/download/weixin_38577551/12934460)[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_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文