toast:是用於進行提示用戶的:
效果:

代碼:
<toast hidden="{{onOff}}" duration="1000" bindchange="clickTap" >默認</toast>
注意:在上面設置了 duration ;但是時間到了也不會消失。原因這里的消失需要改的是 hidden=“true” 。這里只是時間到了會去觸發 bindchange 事件。
所以:需要在 bindtap 里面設置讓這個消失的方法。
除了這種方法:還可以用JS:
btnclick:function(){ wx.showToast({ title:'成功', icon:'success', duration:2000 });
//模擬取消
setTimeout(function(){
wx.hideToast();
},2000); }
如果這個需要手動結束這個 toast,可以設置 10000:
具體參數:
title:提示的內容。
icon:圖標,只支持 success loading
duration:提示的延遲時間,單位毫秒。
success:接口調用成功的回調函數
fail:接口調用失敗的回調函數。
complete:主要調用接口的回調函數。
