49 lines
1.0 KiB
Vue
49 lines
1.0 KiB
Vue
<template>
|
|
<custom-nav-bar :left="true" :title="params.title" />
|
|
<view v-if="params.url">
|
|
<web-view style="margin-top: 45px;" :webview-styles="webviewStyles"
|
|
:src="`${params.url}`"></web-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
var wv; //计划创建的webvie
|
|
export default {
|
|
data() {
|
|
return {
|
|
params: {},
|
|
webviewStyles: {
|
|
progress: {
|
|
color: "#FF3333"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
props: {
|
|
src: {
|
|
type: [String],
|
|
default: null
|
|
}
|
|
},
|
|
onLoad(event) {
|
|
this.params = event
|
|
// if (event.title) {
|
|
// uni.setNavigationBarTitle({
|
|
// title: event.title
|
|
// })
|
|
// }
|
|
},
|
|
onReady() {
|
|
// #ifdef APP-PLUS
|
|
//此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
|
|
var currentWebview = this.$scope.$getAppWebview()
|
|
setTimeout(function() {
|
|
wv = currentWebview.children()[0]
|
|
wv.setStyle({
|
|
top: 60
|
|
})
|
|
}, 100); //如果是页面初始化调用时,需要延时一下
|
|
// #endif
|
|
}
|
|
}
|
|
</script> |