web-view页面
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data() {
return {}
},
onLoad(option) {
this.url = decodeURIComponent(option.url);
console.log('option',decodeURIComponent(option.url))
},
}
</script>
跳转方法
navto(value) { //value为携带参数的url地址
const url = '/页面路径/web-view?url='+encodeURIComponent(value)
uni.navigateTo({
url: url
})
},
encodeURIComponent和decodeURIComponent非常重要,不用的话跳转网页?xxx=xxx的参数会携带不上