提交 75046105 编写于 作者: L laosan_ted

fix webview docs issue

Signed-off-by: Nlaosan_ted <wangruichang@huawei.com>
上级 79b163e2
...@@ -681,6 +681,40 @@ cacheMode(cacheMode: CacheMode) ...@@ -681,6 +681,40 @@ cacheMode(cacheMode: CacheMode)
} }
``` ```
### textZoomAtio<sup>(deprecated)</sup>
textZoomAtio(textZoomAtio: number)
设置页面的文本缩放百分比,默认为100%。
从API version 9开始不再维护,建议使用[textZoomRatio<sup>9+</sup>](#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)
}
}
}
```
### textZoomRatio<sup>9+</sup> ### textZoomRatio<sup>9+</sup>
textZoomRatio(textZoomRatio: number) textZoomRatio(textZoomRatio: number)
...@@ -2865,6 +2899,34 @@ onFaviconReceived(callback: (event: {favicon: image.PixelMap}) => void) ...@@ -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 ## ConsoleMessage
Web组件获取控制台信息对象。示例代码参考[onConsole事件](#onconsole) Web组件获取控制台信息对象。示例代码参考[onConsole事件](#onconsole)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册