From e1dac755558711cfefd469ff8c60b2a10bfd2bc8 Mon Sep 17 00:00:00 2001 From: zyjhandsome Date: Sun, 18 Dec 2022 13:29:42 +0000 Subject: [PATCH] =?UTF-8?q?update=20zh-cn/application-dev/application-mode?= =?UTF-8?q?ls/common-event-subscription.md.=20commonEvent=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BAcommonEventManager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit start build Signed-off-by: zyjhandsome Signed-off-by: zyjhandsome --- .../application-models/common-event-subscription.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/application-models/common-event-subscription.md b/zh-cn/application-dev/application-models/common-event-subscription.md index 4d8742ff9e..459c91a267 100644 --- a/zh-cn/application-dev/application-models/common-event-subscription.md +++ b/zh-cn/application-dev/application-models/common-event-subscription.md @@ -19,10 +19,10 @@ ## 开发步骤 -1. 导入CommonEvent模块。 +1. 导入模块。 ```ts - import commonEvent from '@ohos.commonEventManager'; + import commonEventManager from '@ohos.commonEventManager'; ``` 2. 创建订阅者信息,详细的订阅者信息数据类型及包含的参数请见[CommonEventSubscribeInfo](../reference/apis/js-apis-commonEventManager.md#commoneventsubscribeinfo)文档介绍。 @@ -40,7 +40,7 @@ ```ts // 创建订阅者回调 - commonEvent.createSubscriber(subscribeInfo, (err, data) => { + commonEventManager.createSubscriber(subscribeInfo, (err, data) => { if (err) { console.error(`[CommonEvent] CreateSubscriberCallBack err=${JSON.stringify(err)}`); } else { @@ -56,7 +56,7 @@ ```ts // 订阅公共事件回调 if (subscriber !== null) { - commonEvent.subscribe(subscriber, (err, data) => { + commonEventManager.subscribe(subscriber, (err, data) => { if (err) { console.error(`[CommonEvent] SubscribeCallBack err=${JSON.stringify(err)}`); } else { -- GitLab