|
|
@ -17,8 +17,19 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad(){
|
|
|
|
onLoad(){
|
|
|
|
this.url = decodeURIComponent(this.$Route.query.url)
|
|
|
|
this.url = decodeURIComponent(this.$Route.query.url);
|
|
|
|
console.log();
|
|
|
|
},
|
|
|
|
|
|
|
|
onReady() {
|
|
|
|
|
|
|
|
var currentWebview = this.$scope.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
|
|
|
let wv = currentWebview.children()[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wv.addEventListener('loaded',function() {
|
|
|
|
|
|
|
|
console.log('xxxxx',wv.getURL())
|
|
|
|
|
|
|
|
console.log(wv.getURL()) //获取url
|
|
|
|
|
|
|
|
console.log(wv.getTitle()) //获取标题
|
|
|
|
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
}, 1000); //如果是页面初始化调用时,需要延时一下
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|