未验证 提交 4fc94f66 编写于 作者: O openharmony_ci 提交者: Gitee

!8408 翻译完成:8130 【轻量级 PR】 vibrator-guidelines.md.

Merge pull request !8408 from wusongqing/TR8130
...@@ -65,9 +65,9 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md ...@@ -65,9 +65,9 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
import vibrator from "@ohos.vibrator" import vibrator from "@ohos.vibrator"
vibrator.vibrate(1000).then((error) => { vibrator.vibrate(1000).then((error) => {
if (error) { // The call fails, and error.code and error.message are printed. 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); console.log("Promise return failed.error.code " + error.code + "error.message " + error.message);
} else { // The call is successful, and the device starts to vibrate. } else { // The call is successful, and the device starts to vibrate.
Console.log("Promise returned to indicate a successful vibration.") console.log("Promise returned to indicate a successful vibration.")
} }
}) })
``` ```
...@@ -78,9 +78,9 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md ...@@ -78,9 +78,9 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
import vibrator from "@ohos.vibrator" import vibrator from "@ohos.vibrator"
vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then((error) => { vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then((error) => {
if (error) { // The call fails, and error.code and error.message are printed. 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); console.log("Promise return failed.error.code " + error.code + "error.message " + error.message);
} else { // The call is successful, and the device stops vibrating. } else { // The call is successful, and the device stops vibrating.
Console.log("Promise returned to indicate a successful stop."); console.log("Promise returned to indicate successful.");
} }
}) })
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册