title: swan.vibrateLong header: develop nav: api sidebar: swan-vibrateLong
webUrl: https://qft12m.smartapps.cn/swan-api/vibrate/vibrate
在工具和真机中的实现有区别,详见API 实现差异。
解释: 使手机发生较长时间的振动(400ms)
方法参数
Object object
object
参数说明
属性名 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
success | Function | 否 | 接口调用成功的回调 | |
fail | Function | 否 | 接口调用失败的回调函数 | |
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
示例
扫码体验

代码示例
- 在 js 文件中
Page({
vibrateLong() {
swan.vibrateLong({
success: res => {
console.log('vibrateLong success', res);
},
fail: err => {
console.log('vibrateLong fail', err);
}
});
}
});