|
@@ -116,6 +116,9 @@ export struct XWebview {
|
|
.width('100%')
|
|
.width('100%')
|
|
|
|
|
|
Web({ src: this.url ?? 'www.example.com', controller: this.controller })
|
|
Web({ src: this.url ?? 'www.example.com', controller: this.controller })
|
|
|
|
+ .javaScriptAccess(true)
|
|
|
|
+ .domStorageAccess(true)
|
|
|
|
+ .geolocationAccess(true)
|
|
.width('100%')
|
|
.width('100%')
|
|
.height('100%')
|
|
.height('100%')
|
|
.visibility(this.errorInfo == null ? Visibility.Visible : Visibility.None)
|
|
.visibility(this.errorInfo == null ? Visibility.Visible : Visibility.None)
|
|
@@ -184,6 +187,7 @@ export struct XWebview {
|
|
} else {
|
|
} else {
|
|
this.errorInfo = '错误码:-1\n未知错误'
|
|
this.errorInfo = '错误码:-1\n未知错误'
|
|
}
|
|
}
|
|
|
|
+ ToolsHelper.log(this.errorInfo)
|
|
})
|
|
})
|
|
.onHttpErrorReceive((event) => { // 加载失败
|
|
.onHttpErrorReceive((event) => { // 加载失败
|
|
if (this.progress > 65) {
|
|
if (this.progress > 65) {
|
|
@@ -194,6 +198,7 @@ export struct XWebview {
|
|
} else {
|
|
} else {
|
|
this.errorInfo = '错误码:-1\n未知错误'
|
|
this.errorInfo = '错误码:-1\n未知错误'
|
|
}
|
|
}
|
|
|
|
+ ToolsHelper.log(this.errorInfo)
|
|
})
|
|
})
|
|
.onProgressChange((event) => { // 加载进度
|
|
.onProgressChange((event) => { // 加载进度
|
|
if (event) {
|
|
if (event) {
|