From e21f83ebb52b823ba2101071da1a7d28e2a6eb62 Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Wed, 7 Jun 2023 16:07:46 +0800 Subject: [PATCH] fix Sample bugs for ArkTS card. Signed-off-by: zhongjianfei Change-Id: If8b852f08bdddc093fb482a30f19c65c239a500a --- .../application-models/arkts-ui-widget-event-call.md | 6 ++++-- .../application-models/arkts-ui-widget-event-overview.md | 2 +- .../application-models/arkts-ui-widget-event-uiability.md | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/application-models/arkts-ui-widget-event-call.md b/zh-cn/application-dev/application-models/arkts-ui-widget-event-call.md index cedc34b23b..0289fc6798 100644 --- a/zh-cn/application-dev/application-models/arkts-ui-widget-event-call.md +++ b/zh-cn/application-dev/application-models/arkts-ui-widget-event-call.md @@ -60,7 +60,7 @@ } function FunBCall(data) { - console.info('FunACall param:' + JSON.stringify(data.readString())); + console.info('FunBCall param:' + JSON.stringify(data.readString())); return null; } @@ -71,11 +71,13 @@ // 监听call事件所需的方法 this.callee.on('funA', FunACall); this.callee.on('funB', FunBCall); - } catch (error) { + } catch (err) { console.error(`Failed to register callee on. Cause: ${JSON.stringify(err)}`); } } + ... + // 进程退出时,解除监听 onDestroy() { try { diff --git a/zh-cn/application-dev/application-models/arkts-ui-widget-event-overview.md b/zh-cn/application-dev/application-models/arkts-ui-widget-event-overview.md index 1e984be68a..67845df50f 100644 --- a/zh-cn/application-dev/application-models/arkts-ui-widget-event-overview.md +++ b/zh-cn/application-dev/application-models/arkts-ui-widget-event-overview.md @@ -55,7 +55,7 @@ Button('拉至后台') 'abilityName': 'EntryAbility', 'params': { 'method': 'fun', // 自定义调用的方法名,必填 - 'message': 'testForcall' // 自定义要发送的message + 'message': 'testForCall' // 自定义要发送的message } }); }) diff --git a/zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md b/zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md index 009683ed2d..857c403ab6 100644 --- a/zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md +++ b/zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md @@ -148,7 +148,6 @@ import UIAbility from '@ohos.app.ability.UIAbility'; import formBindingData from '@ohos.app.form.formBindingData'; import formProvider from '@ohos.app.form.formProvider'; - import formInfo from '@ohos.app.form.formInfo'; const MSG_SEND_METHOD: string = 'funA'; -- GitLab