WCML
<view bindtap="viewTap">绑定了事件</view>
JS
viewTap:function(){
wx.showToast({
title: ‘成功‘,
icon: ‘success‘,
duration: 2000
})
}
学习链接:https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showToast.html