提交 0b5a1765 编写于 作者: X xinking129

Modification review suggestions

Signed-off-by: Nxinking129 <xinxin13@huawei.com>
上级 dea1e749
......@@ -2605,7 +2605,7 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise&lt;Caller&
reportDrawnCompleted(callback: AsyncCallback<void>): void;
页面加载完成时为开发者提供打点功能(callback形式)
当页面加载完成(loadContent成功)时,为开发者提供打点功能(callback形式)
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -2627,18 +2627,26 @@ reportDrawnCompleted(callback: AsyncCallback<void>): void;
**示例:**
```ts
try {
this.context.reportDrawnCompleted((err) => {
if (err.code) {
// 处理业务逻辑错误
console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`);
return;
}
// 执行正常业务
console.info('reportDrawnCompleted succeed');
onWindowStageCreate(windowStage: Window.WindowStage) {
windowStage.loadContent('pages/Index', (err, data) => {
if (err.code) {
return;
}
try {
this.context.reportDrawnCompleted((err) => {
if (err.code) {
// 处理业务逻辑错误
console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`);
return;
}
// 执行正常业务
console.info('reportDrawnCompleted succeed');
});
} catch (err) {
// 捕获同步的参数错误
console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`);
}
});
} catch (err) {
// 捕获同步的参数错误
console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`);
}
console.log("MainAbility onWindowStageCreate")
}
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册