diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md index a3781242346241c0874800558095b6c205a0a0c2..194910c3d3fc29a5b569b4982cb98f817715b8fd 100755 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md @@ -3099,6 +3099,43 @@ onAudioStateChanged(callback: (event: { playing: boolean }) => void) } ``` +### onFirstContentfulPaint10+ + +onFirstContentfulPaint(callback: (event?: { navigationStartTick: number, + firstContentfulPaintMs: number }) => void) + +设置网页首次内容绘制回调函数。 + +**参数:** + +| 参数名 | 参数类型 | 参数描述 | +| -----------------------| -------- | ----------------------------------- | +| navigationStartTick | number | navigation开始的时间,单位以微秒表示 | +| firstContentfulPaintMs | number | 从navigation开始第一次绘制内容的时间。单位是以毫秒表示 | + +**示例:** + + ```ts + // xxx.ets + import web_webview from '@ohos.web.webview' + @Entry + @Component + struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController() + + build() { + Column() { + Web({ src:'www.example.com', controller: this.controller }) + .onFirstContentfulPaint(event => { + console.log("onFirstContentfulPaint:" + "[navigationStartTick]:" + + event.navigationStartTick + ", [firstContentfulPaintMs]:" + + event.firstContentfulPaintMs) + }) + } + } + } + ``` + ### onLoadIntercept10+ onLoadIntercept(callback: (event?: { data: WebResourceRequest }) => boolean)