wx.showToast

icon的使用

icon主要有三种,success,loading和none

  • 显示成功图标


    wx.showToast_第1张图片
wx.showToast({
  title: '成功',
  icon: 'success',
  duration: 4000 //延时时间长一点好截图
})
  • 显示加载图标


    wx.showToast_第2张图片
wx.showToast({
        title: '加载',
        icon: 'loading',
        duration: 4000
    })
  • 不显示图标


    wx.showToast_第3张图片
primary: function(){
    wx.showToast({
        title: 'hi',
        icon: 'none',
        duration: 4000
    })

image的使用

wx.showToast_第4张图片
primary: function(){
    wx.showToast({
        title: 'hi',
        image: '../../images/1.png', //image的优先级比icon高,所以不显示icon
        icon: 'loading',
        duration: 4000 
    })

你可能感兴趣的:(wx.showToast)