微信小程序-消息提示框

一、showToast 页面加载效果javascript

  // onLoad 事件中定义     wx.showToast({ title: '加载中', icon: 'loading', duration: 10000 })
setTimeout(function () { wx.hideToast() }, 2000)


二、showToast消息提示框css

<!--index.wxml--> <button  type="primary"  bindtap="showToast">showToast </button> 

  //index.js showToast: function ( wx.showToast({ title: '成功', icon: 'success', duration: 2000 }) }


三、showModal显示模态弹窗java

<!--index.wxml--> <button type="default" bindtap="showModal">showModal</button>

 //index.js showModal :function(){ wx.showModal({ title: '提示', content: '这是一个模态弹窗', success: function (res) { if (res.confirm) { console.log('用户点击肯定') } } })  }


四、showActionSheet显示操做菜单微信

<!--index.wxml--> <button type="warn" bindtap="showActionSheet">showActionSheet</button>

 //index.js showActionSheet: function () { wx.showActionSheet({ itemList: ['A', 'B', 'C'], success: function (res) { if (!res.cancel) { console.log(res.tapIndex) } } }) }


五、setNavigationBarTitle 设置导航条app

   // onLoad 事件中定义 wx.setNavigationBarTitle({ title: 'Toast案例' })


更多文章请关注公众号,谢谢 ide

联系方式:13128600812ui


本文分享自微信公众号 - IT技术屋(zhanglcxyworkshop)。
若有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一块儿分享。spa

相关文章
相关标签/搜索