未验证 提交 57f74b59 编写于 作者: O openharmony_ci 提交者: Gitee

!4096 翻译完成:3904 【轻量级...

!4096 翻译完成:3904 【轻量级 PR】:【OpenHarmony开源贡献者计划2022】zh-cn/application-dev/device/vibrator-guidelines.md 中的示例代码格式问题
Merge pull request !4096 from wusongqing/TR3904
......@@ -20,38 +20,38 @@ You can set different vibration effects as needed, for example, customizing the
## How to Develop
1. Declare the permissions required for controlling vibrators on the hardware device in the **config.json** file.
1. Declare the permissions required for controlling vibrators on the hardware device in the `config.json` file.
```
"reqPermissions":[
"reqPermissions": [
{
"name":"ohos.permission.ACCELEROMETER",
"reason"":"",
"usedScene":{
"ability""[
".MainAbility"
"name": "ohos.permission.ACCELEROMETER",
"reason": "",
"usedScene": {
"ability": [
".MainAbility"
],
"when":"inuse"
"when": "inuse"
}
},
{
"name":"ohos.permission.VIBRATE",
"reason"":"",
"usedScene":{
"ability""[
".MainAbility"
"name": "ohos.permission.VIBRATE",
"reason": "",
"usedScene": {
"ability": [
".MainAbility"
],
"when":"inuse"
"when": "inuse"
}
},
{
"name":"ohos.permission.ACTIVITY_MOTION",
"reason"":"",
"usedScene":{
"ability""[
".MainAbility"
"name": "ohos.permission.ACTIVITY_MOTION",
"reason": "",
"usedScene": {
"ability": [
".MainAbility"
],
"when":"inuse"
"when": "inuse"
}
},
]
......@@ -77,7 +77,7 @@ You can set different vibration effects as needed, for example, customizing the
vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then((error)=>{
if(error){ // The call fails, and error.code and error.message are printed.
Console.log("Promise return failed.error.code"+error.code+"error.message"+error.message);
}else{ // The call is successful, and the device stops vibration.
}else{ // The call is successful, and the device stops vibrating.
Console.log("Promise returned to indicate a successful stop.");
};
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册