From 7504610580d55f1405c93f03a83898ba7c16f59e Mon Sep 17 00:00:00 2001 From: laosan_ted Date: Thu, 27 Apr 2023 15:07:43 +0800 Subject: [PATCH] fix webview docs issue Signed-off-by: laosan_ted --- .../arkui-ts/ts-basic-components-web.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) 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 d5e64aa4ed..4a114e4cf6 100644 --- 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 @@ -681,6 +681,40 @@ cacheMode(cacheMode: CacheMode) } ``` +### textZoomAtio(deprecated) + +textZoomAtio(textZoomAtio: number) + +设置页面的文本缩放百分比,默认为100%。 + +从API version 9开始不再维护,建议使用[textZoomRatio9+](#textzoomratio9)代替。 + +**参数:** + +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------------- | ------ | ---- | ---- | --------------- | +| textZoomAtio | number | 是 | 100 | 要设置的页面的文本缩放百分比。 | + +**示例:** + + ```ts + // xxx.ets + import web_webview from '@ohos.web.webview' + + @Entry + @Component + struct WebComponent { + controller: WebController = new WebController() + @State atio: number = 150 + build() { + Column() { + Web({ src: 'www.example.com', controller: this.controller }) + .textZoomAtio(this.atio) + } + } + } + ``` + ### textZoomRatio9+ textZoomRatio(textZoomRatio: number) @@ -2865,6 +2899,34 @@ onFaviconReceived(callback: (event: {favicon: image.PixelMap}) => void) } ``` +### onRequestSelected + +onRequestSelected(callback: () => void) + +当Web组件获得焦点时触发该回调。 + +**示例:** + + ```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 }) + .onRequestSelected(() => { + console.log('onRequestSelected') + }) + } + } + } + ``` + ## ConsoleMessage Web组件获取控制台信息对象。示例代码参考[onConsole事件](#onconsole)。 -- GitLab