添加一个webview页面并添加到 pages.json
{
"path" : "webview/webview",
"style" : {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
webview页面内容
<template>
<view class="container">
<web-view :src="externalUrl"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
externalUrl: ''
};
},
onLoad() {
this.externalUrl = this.$route.query.url;
}
};
</script>
<style scoped>
.container {
width: 100%;
height: 100vh;
}
</style>
跳转方法
uni.navigateTo({
url: '/pagesC/webview/webview?url=https://www.baidu.com'
});