HomeDocs
Skip to main content

dlt.vibrate

Introduction

Triggers vibration on the phone.

Usage Limitations

Supported by basic library version 4.0.0 or higher.

Parameters

Object object

AttributeTypeDefault ValueRequiredDescription
millisecondsnumberYesDuration of vibration (0-1000ms)
successfunctionNoCallback function for a successful API call
failfunctionNoCallback function for a failed API call
completefunctionNoCallback function for the end of an API call (executed for both successful and failed calls)

Sample Code

// pages/index/index.js
Page({
vibrate() {
dlt.vibrate({
milliseconds: 500,
success: function (res) {},
fail: function (res) {},
complete: function (res) {},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.