Page({
data: {
url: ""
},
onLoad(options) {
if(options.url){
this.setData({
url: decodeURIComponent(options.url)
})
}
},
})
3、index.wxml
<web-view src="{{url}}"></web-view>
wx.navigateTo({
url: "/pages/webview/index?url=" + encodeURIComponent(‘www.baidu.com’)
})