HarmonyOS 鸿蒙Next web加载备案号地址展示为白屏
HarmonyOS 鸿蒙Next web加载备案号地址展示为白屏
我们项目中用到了web加载备案号地址,但展示时为白屏,想请问下是什么原因,代码如下:
@Entry
@Component
struct BrowerPage {
pageTitle: string = ""
url: string = ""
controller: web_webview.WebviewController = new web_webview.WebviewController();
aboutToAppear() {
YdLogger.debug(JSONUtil.beanToJsonStr(router.getParams()))
this.pageTitle = ""
this.url = "xxx"
}
build() {
Column() {
YdCustomNavigation({ mTitle: this.pageTitle })
Column(){
Web({ src: this.url, controller: this.controller})
.javaScriptAccess(true)
.fileAccess(true)
.domStorageAccess(true)
.geolocationAccess(true)
.imageAccess(true)
.cacheMode(CacheMode.None)
.backgroundColor($r('app.color.white'))
.height(CommonConstants.YD_FULL_WITH)
.width(CommonConstants.YD_FULL_HEIGHT)
}
.layoutWeight(1)
.width(CommonConstants.YD_FULL_HEIGHT)
}
}
}
更多关于HarmonyOS 鸿蒙Next web加载备案号地址展示为白屏的实战教程也可以访问 https://www.itying.com/category-93-b0.html
2 回复
```
.onSslErrorEventReceive((e) => {
e.handler.handleConfirm()
})
```
具体参考链接:
咱们给web组件加上以下属性,然后卸载测试真机上的app重新运行项目安装下看看:
```
.cacheMode(CacheMode.Online)
.mixedMode(MixedMode.All)
```
更多关于HarmonyOS 鸿蒙Next web加载备案号地址展示为白屏的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html