diff --git a/pages/component/web-view-local/web-view-local.uvue b/pages/component/web-view-local/web-view-local.uvue
index 89300c896b0b5dd6dc2b94a77e71509e373c53dc..d7468acf52092b364a4b4e16a59b0bf646ab2d65 100644
--- a/pages/component/web-view-local/web-view-local.uvue
+++ b/pages/component/web-view-local/web-view-local.uvue
@@ -1,6 +1,6 @@
+ @loading="loading" @load="load">
@@ -13,23 +13,23 @@
}
},
methods: {
- message(event : WebViewMessageEvent) {
- console.log(JSON.stringify(event.detail));
+ message(event : UniWebViewMessageEvent) {
+ console.log(JSON.stringify(event));
uni.showModal({
content: JSON.stringify(event.detail),
showCancel: false
});
},
- error(event : WebViewErrorEvent) {
+ error(event : UniWebViewErrorEvent) {
this.loadError = true
- console.log(JSON.stringify(event.detail));
+ console.log(JSON.stringify(event));
},
- loading(event : WebViewLoadingEvent) {
- console.log(JSON.stringify(event.type));
+ loading(event : UniWebViewLoadingEvent) {
+ console.log(JSON.stringify(event));
},
- loaded(event : WebViewLoadedEvent) {
+ load(event : UniWebViewLoadEvent) {
this.loadFinish = true;
- console.log(JSON.stringify(event.type));
+ console.log(JSON.stringify(event));
}
}
}
diff --git a/pages/component/web-view/web-view.uvue b/pages/component/web-view/web-view.uvue
index d8fc32bba8ca06572256b1e508a90a45ead72a94..0db4dd42936c66ac7628fc07d1e3c292ea14f772 100644
--- a/pages/component/web-view/web-view.uvue
+++ b/pages/component/web-view/web-view.uvue
@@ -1,7 +1,7 @@
+ @error="error" @loading="loading" @load="load" @download="download">
@@ -58,27 +58,27 @@
nativeToWeb() {
this.webviewContext?.evalJS("alert('hello uni-app x')");
},
- message(event : WebViewMessageEvent) {
+ message(event : UniWebViewMessageEvent) {
console.log(JSON.stringify(event));
},
- error(event : WebViewErrorEvent) {
+ error(event : UniWebViewErrorEvent) {
this.loadError = true
console.log(JSON.stringify(event));
},
- loading(event : WebViewLoadingEvent) {
+ loading(event : UniWebViewLoadingEvent) {
console.log(JSON.stringify(event));
},
- loaded(event : WebViewLoadedEvent) {
+ load(event : UniWebViewLoadEvent) {
console.log(JSON.stringify(event));
},
- download(event : WebViewDownloadEvent) {
+ download(event : UniWebViewDownloadEvent) {
console.log(JSON.stringify(event));
uni.showModal({
content: "下载链接: " + event.detail.url + "\n文件大小: " + event.detail.contentLength / 1024 + "KB",
showCancel: false
});
},
- confirm(event : InputConfirmEvent) {
+ confirm(event : UniInputConfirmEvent) {
console.log(JSON.stringify(event));
let url = event.detail.value;
if (!url.startsWith('https://') && !url.startsWith('http://')) {