1、代码
@Entry
@Component
struct Index {
controller: WebController = new WebController();
build() {
Row() {
Column() {
Web({ src: 'https://wap.eastmoney.com/', controller: this.controller })
.height('100%')
.width('100%')
.fileAccess(true)
.javaScriptAccess(true)
}
.width('100%')
}
.height('100%')
}
}
2、添加权限
config.json:
"reqPermissions": [{"name": "ohos.permission.INTERNET"}]