mui.confirm中回调函数需要加event变量控制对话框的行为

1 mui('#history-title').on('tap', 'p', function(){
2      mui.confirm('是否要删除全部搜索记录?','提示',['是','否'],(event)=>{
3          if (event.index === 0){ // 使用event.index获取用户选择的选项索引
4          window.localStorage.removeItem('historySearch')
5          fGetStorage()
6          mui.toast('清除成功',{ duration:'short', type:'div' }) 
7          }
8      })
9 })

 

posted @ 2021-05-12 22:31  你本无意丶穿堂风  阅读(257)  评论(0)    收藏  举报