● 使手机发生较短时间的振动vibrateShort
分类:振动
是否支持H5:不支持
参数
Object object
| 参数名 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| type | params | 否 | heavy/medium/light heavy:约 40ms 强震动medium:约 30ms 中等 light:约 20ms 轻微震动 APP版本 5.58.1 生效配置 | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 | |
| complete | function | 否 | 接口调用结束的回调函数(接口调用成功、失败都会执行) |
参数
object.fail 回调函数
| 属性 | 类型 | 说明 |
|---|---|---|
| errMsg | string | 错误信息 |
调用示例
原生
wx.vibrateShort({
type: 'medium',
success (res) {
console.log('成功:'+JSON.stringify(res))
},fail (res) {
console.log('失败:'+JSON.stringify(res))
},complete (res) {
console.log('结束:'+JSON.stringify(res))
}
})