微信小程序-提交表单成功弹窗提示

微信小程序中toast消息提示框只有两种显示的效果,就是成功和加载,使用wx.showToast()。

代码很简单

wxml:

<button type="primary" bindtap="showToast">保存提交</button>

js:

Page({
    showToast(){
        wx.showToast({
          title: '提交成功',
          icon: 'success',
          duration: 2000//持续的时间
        })
      }
   
})

猜你喜欢

转载自blog.csdn.net/ZgaoYi/article/details/121590464