From 8703f5222b22575b6fb2156c2023357f19a38440 Mon Sep 17 00:00:00 2001 From: fengli1111111 Date: Wed, 3 Aug 2022 09:51:31 +0000 Subject: [PATCH] =?UTF-8?q?update=20zh-cn/application-dev/notification/com?= =?UTF-8?q?mon-event.md.=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E7=BC=A9?= =?UTF-8?q?=E8=BF=9B=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E7=BC=A9?= =?UTF-8?q?=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lifengr --- .../notification/common-event.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/zh-cn/application-dev/notification/common-event.md b/zh-cn/application-dev/notification/common-event.md index f3fc6028ca..fd6f6a31e7 100644 --- a/zh-cn/application-dev/notification/common-event.md +++ b/zh-cn/application-dev/notification/common-event.md @@ -98,11 +98,11 @@ import commonEvent from '@ohos.commonEvent'; ```js //发布公共事件 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 //公共事件相关信息 var options = { - code: 1, //公共事件的初始代码 - data: "initial data",//公共事件的初始数据 + code: 1, //公共事件的初始代码 + data: "initial data",//公共事件的初始数据 } ``` @@ -128,11 +128,11 @@ var options = { ```js //发布公共事件 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