From 2383a59e61342a72b8fd3628cc060228a0e45ab1 Mon Sep 17 00:00:00 2001 From: HuangXW Date: Mon, 19 Sep 2022 10:18:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=88=86=E5=8F=B7=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: HuangXW --- .../reference/apis/js-apis-extension-context.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-extension-context.md b/zh-cn/application-dev/reference/apis/js-apis-extension-context.md index 3f688e184d..42464e2b1b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-extension-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-extension-context.md @@ -31,7 +31,7 @@ ExtensionContext主要用于查询所属Extension的信息、Module的配置信 三个Module内都定义一个相同名称的ServiceExtension: ``` js import ServiceExtension from '@ohos.application.ServiceExtensionAbility' -import Want from '@ohos.application.Want'; +import Want from '@ohos.application.Want' export default class TheServiceExtension extends ServiceExtension { onCreate(want:Want) { console.log('ServiceAbility onCreate, want: ' + want.abilityName); @@ -55,7 +55,7 @@ export default class TheServiceExtension extends ServiceExtension { onDestroy() { console.log('ServiceAbility onDestroy'); } -} +}; ``` 在entry的MainAbility的onCreate回调内启动ServiceExtension @@ -108,5 +108,5 @@ export default class ServiceModel { break; } } -} +}; ``` -- GitLab