未验证 提交 12e72582 编写于 作者: O openharmony_ci 提交者: Gitee

!20348 提交页面绘制完成打点文档说明

Merge pull request !20348 from xinking129/master
......@@ -2600,3 +2600,52 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise<Caller&
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
## UIAbilityContext.reportDrawnCompleted
reportDrawnCompleted(callback: AsyncCallback<void>): void;
当页面加载完成(loadContent成功)时,为开发者提供打点功能(callback形式)。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | 是 | 页面加载完成打点的回调函数。 |
**错误码:**
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000011 | The context does not exist. |
| 16000050 | Internal error. |
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:**
```ts
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}`);
}
});
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.
先完成此消息的编辑!
想要评论请 注册