Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
7f1dd4de
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7f1dd4de
编写于
12月 12, 2022
作者:
C
chensi10
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modification of reviews
Signed-off-by:
N
chensi10
<
chensi52@huawei.com
>
上级
1ceee25e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
17 deletion
+31
-17
zh-cn/application-dev/reference/apis/js-apis-webview.md
zh-cn/application-dev/reference/apis/js-apis-webview.md
+21
-6
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
...ication-dev/reference/arkui-ts/ts-basic-components-web.md
+10
-11
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-webview.md
浏览文件 @
7f1dd4de
...
...
@@ -2310,9 +2310,17 @@ struct WebComponent {
Column
()
{
Button
(
'
hasImageCb
'
)
.
onClick
(()
=>
{
this
.
controller
.
hasImage
((
err
,
data
)
=>
{
console
.
log
(
"
hasImage:
"
+
data
);
});
try
{
this
.
controller
.
hasImage
((
err
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
`hasImage error: `
+
JSON
.
stringify
(
error
))
return
;
}
console
.
info
(
"
hasImage:
"
+
data
);
});
}
catch
(
error
)
{
console
.
error
(
`ErrorCode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
}
})
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
}
...
...
@@ -2358,9 +2366,16 @@ struct WebComponent {
Column
()
{
Button
(
'
hasImagePm
'
)
.
onClick
(()
=>
{
this
.
controller
.
hasImage
().
then
((
data
)
=>
{
console
.
info
(
"
hasImage:
"
+
data
)
});
try
{
this
.
controller
.
hasImage
().
then
((
data
)
=>
{
console
.
info
(
'
hasImage:
'
+
data
);
})
.
catch
(
function
(
error
)
{
console
.
error
(
"
error:
"
+
error
);
})
}
catch
(
error
)
{
console
.
error
(
`Errorcode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
}
})
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
}
...
...
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
浏览文件 @
7f1dd4de
...
...
@@ -2393,7 +2393,7 @@ onDataResubmitted(callback: (event: {handler: DataResubmissionHandler}) => void)
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
onDataResubmitted
((
event
)
=>
{
.
onDataResubmitted
((
event
)
=>
{
console
.
log
(
'
onDataResubmitted
'
)
event
.
handler
.
resend
();
})
...
...
@@ -2426,7 +2426,7 @@ onPageVisible(callback: (event: {url: string}) => void)
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
onPageVisible
((
event
)
=>
{
.
onPageVisible
((
event
)
=>
{
console
.
log
(
'
onPageVisible url:
'
+
event
.
url
)
})
}
...
...
@@ -2464,7 +2464,7 @@ onInterceptKeyEvent(callback: (event: KeyEvent) => boolean)
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
onInterceptKeyEvent
((
event
)
=>
{
.
onInterceptKeyEvent
((
event
)
=>
{
if
(
event
.
keyCode
==
2017
||
event
.
keyCode
==
2018
)
{
console
.
info
(
`onInterceptKeyEvent get event.keyCode
${
event
.
keyCode
}
`
)
return
true
;
...
...
@@ -2500,8 +2500,8 @@ onTouchIconUrlReceived(callback: (event: {url: string, precomposed: boolean}) =>
controller
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
()
build
()
{
Column
()
{
Web
({
src
:
'
www.
example
.com
'
,
controller
:
this
.
controller
})
.
onTouchIconUrlReceived
((
event
)
=>
{
Web
({
src
:
'
www.
baidu
.com
'
,
controller
:
this
.
controller
})
.
onTouchIconUrlReceived
((
event
)
=>
{
console
.
log
(
'
onTouchIconUrlReceived:
'
+
JSON
.
stringify
(
event
))
})
}
...
...
@@ -2535,7 +2535,8 @@ onFaviconReceived(callback: (event: {favicon: image.PixelMap}) => void)
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
onFaviconReceived
((
event
)
=>
{
.
onFaviconReceived
((
event
)
=>
{
console
.
log
(
'
onFaviconReceived:
'
+
JSON
.
stringify
(
event
))
this
.
icon
=
event
.
favicon
;
})
}
...
...
@@ -6177,7 +6178,7 @@ resend(): void
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
onDataResubmitted
((
event
)
=>
{
.
onDataResubmitted
((
event
)
=>
{
console
.
log
(
'
onDataResubmitted
'
)
event
.
handler
.
resend
();
})
...
...
@@ -6204,13 +6205,11 @@ cancel(): void
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
onDataResubmitted
((
event
)
=>
{
.
onDataResubmitted
((
event
)
=>
{
console
.
log
(
'
onDataResubmitted
'
)
event
.
handler
.
cancel
();
})
}
}
}
```
###
\ No newline at end of file
```
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录