Taro.vibrateLong(param)
使手机发生较长时间的振动(400 ms)。
使用方式同 wx.vibrateLong,支持 Promise 化使用。
参数
object param
| Property | Type | Default | Description |
|---|---|---|---|
| [success] | function | 接口调用成功的回调函数 | |
| [fail] | function | 接口调用失败的回调函数 | |
| [complete] | function | 接口调用结束的回调函数(调用成功、失败都会执行) |
示例代码
import Taro from '@tarojs/taro'
Taro.vibrateLong(params).then(...)
API支持度
| API | 微信小程序 | H5 | React Native |
|---|---|---|---|
| Taro.vibrateLong | ✔️ | ✔️ | ✔️ |