振动
my.vibrate(OBJECT)
调用振动功能。扫码体验:
代码示例
Page({
vibrate() {
my.vibrate({
success: () => {
my.alert({ title: '震动起来了'});
}
});
},
})
my.vibrateLong(OBJECT)
较长时间的振动 (400ms),扫码体验:
代码示例
Page({
vibrateLong() {
my.vibrateLong({
success: () => {
my.alert({ title: '震动起来了'});
}
});
},
})
my.vibrateShort(OBJECT)
较短时间的振动 (40ms),扫码体验:
代码示例
Page({
vibrateShort() {
my.vibrateShort({
success: () => {
my.alert({ title: '震动起来了'});
}
});
},
})