震动

接口声明

  1. { "name": "system.vibrator" }

导入模块

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

接口定义

vibrator.vibrate(OBJECT)

触发震动

参数:

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

示例:

  1. vibrator.vibrate({
  2. mode: 'long'
  3. })

后台运行限制

禁止使用。后台运行详细用法参见后台运行 脚本