如何加载一个网页链接到页面中?

如何加载一个网页链接到页面中?

HarmonyOS
2024-08-05 17:13:24
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
橱柜里的蛙
import { webview } from '@kit.ArkWeb';//导入ArkWeb库
@Entry
@Component
struct Index {
  controller: webview.WebviewController = new webview.WebviewController();//创建Web的控制器

  build() {
    Column() {
      Web({ src: "http://www.baidu.com", controller: this.controller }).width("100%")
        .height("100%")
    }
    .width('100%')
    .height('100%')
    .justifyContent(FlexAlign.Center)
  }
}
分享
微博
QQ
微信
回复
2024-08-05 22:20:11
相关问题
如何实现一个页面显示子窗口
994浏览 • 1回复 待解决