未验证 提交 104f2526 编写于 作者: O openharmony_ci 提交者: Gitee

!19322 优化ArkTS卡片示例代码

Merge pull request !19322 from zhongjianfei/mm0607
......@@ -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 {
......
......@@ -55,7 +55,7 @@ Button('拉至后台')
'abilityName': 'EntryAbility',
'params': {
'method': 'fun', // 自定义调用的方法名,必填
'message': 'testForcall' // 自定义要发送的message
'message': 'testForCall' // 自定义要发送的message
}
});
})
......
......@@ -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';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册