阅读(138) (0)

快应用 震动

2018-06-20 19:35:26 更新

接口声明

{"name": "system.vibrator"}

导入模块

import vibrator from '@system.vibrator' 
或 
const vibrator = require('@system.vibrator')

接口定义

vibrator.vibrate()

触发震动

参数:

参数类型必填说明
mode 1030+String振动模式,"long" 表示长振动,"short" 表示短振动。默认为 long

示例:

vibrator.vibrate({
  mode: 'long'

后台运行限制

禁止使用。

后台运行详细用法参见 后台运行脚本