//wxml中
<button bindtap="LongTap">振动(400ms)</button>
<button bindtap="ShortTap">振动(15ms)</button>
//js文件中
LongTap() {
// 手机振动时间400ms
wx.vibrateLong();
},
ShortTap() {
// 手机振动时间15ms
wx.vibrateShort();
},
版权声明:本文为tangyuan97原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。