微信小程序 --- toast消息提示框

提示用户

效果:

<toast hidden="{{onOff}}" duration="1000" bindchange="clickTap" >默认</toast>

btnclick:function(){

    wx.showToast({
        title:'成功',
        icon:'success',
        duration:2000
    });
}

具体参数

title:提示的内容。

icon:图标,只支持  success   loading

duration:提示的延迟时间,单位毫秒。

success:接口调用成功的回调函数

fail:接口调用失败的回调函数。

complete:主要调用接口的回调函数。

效果:

<toast hidden="{{onOff}}" duration="1000" bindchange="clickTap" >默认</toast>

btnclick:function(){

    wx.showToast({
        title:'成功',
        icon:'success',
        duration:2000
    });
}

具体参数

title:提示的内容。

icon:图标,只支持  success   loading

duration:提示的延迟时间,单位毫秒。

success:接口调用成功的回调函数

fail:接口调用失败的回调函数。

complete:主要调用接口的回调函数。

猜你喜欢

转载自www.cnblogs.com/lsyy2017/p/11619239.html