From 0b468a563a1310b1ef291e970d73ea52163794f1 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Wed, 10 Aug 2022 14:15:59 +0800 Subject: [PATCH] update common-event.md (7720) Signed-off-by: ester.zhou --- .../notification/common-event.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/en/application-dev/notification/common-event.md b/en/application-dev/notification/common-event.md index 8450f3d8c7..d5a6d7bdfb 100644 --- a/en/application-dev/notification/common-event.md +++ b/en/application-dev/notification/common-event.md @@ -98,11 +98,11 @@ import commonEvent from '@ohos.commonEvent'; ```js // Publish a common event. commonEvent.publish("event", (err) => { - if (err.code) { - console.error("[CommonEvent]PublishCallBack err=" + JSON.stringify(err)) - } else { - console.info("[CommonEvent]Publish1") - } + if (err.code) { + console.error("[CommonEvent]PublishCallBack err=" + JSON.stringify(err)) + } else { + console.info("[CommonEvent]Publish1") + } }) ``` @@ -118,8 +118,8 @@ import commonEvent from '@ohos.commonEvent' ```js // Attributes of a common event. var options = { - code: 1, // Result code of the common event - data: "initial data";// Result data of the common event + code: 1, // Result code of the common event + data: "initial data",// Result data of the common event } ``` @@ -128,11 +128,11 @@ var options = { ```js // Publish a common event. commonEvent.publish("event", options, (err) => { - if (err.code) { - console.error("[CommonEvent]PublishCallBack err=" + JSON.stringify(err)) - } else { - console.info("[CommonEvent]Publish2") - } + if (err.code) { + console.error("[CommonEvent]PublishCallBack err=" + JSON.stringify(err)) + } else { + console.info("[CommonEvent]Publish2") + } }) ``` -- GitLab