提交 85cee149 编写于 作者: L lixingchi1

lixingchi1@huawei.com

Signed-off-by: Nlixingchi1 <lixingchi1@huawei.com>
上级 361662f9
...@@ -99,9 +99,9 @@ struct WebComponent { ...@@ -99,9 +99,9 @@ struct WebComponent {
controller: WebController = new WebController(); controller: WebController = new WebController();
build() { build() {
Column() { Column() {
Web(src: $rawfile('index.html'), controller: this.controller) Web({ src: $rawfile('index.html'), controller: this.controller })
.javaScriptAccess(javaScriptAccess) .javaScriptAccess(this.javaScriptAccess)
.fileAccess(fileAccess) .fileAccess(this.fileAccess)
.onPageEnd(e => { .onPageEnd(e => {
// test() 在 index.html 中已定义 // test() 在 index.html 中已定义
this.controller.runJavaScript('test()'); this.controller.runJavaScript('test()');
...@@ -110,8 +110,9 @@ struct WebComponent { ...@@ -110,8 +110,9 @@ struct WebComponent {
} }
} }
} }
```
// index.html ```
<!-- index.html -->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<meta charset="utf-8"> <meta charset="utf-8">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册