在做項目中需要讓頁面跳到外網,用到了<web-view src=""> </web-view>組件,需要新建一個文件放這個組件,調接口的時候鏈接連到這個頁面,當我把參數傳過去的時候,出現了 page[pages/XXX/XXX] not found.May be caused by :1. Forgot to add page route in app.json.2. Invoking Page() in async task.導致參數沒有傳過去,百度了一下是因為在app.json里面的路由填寫順序問題,最后貼上我的代碼:
data:{
site:''//外網地址
}
url: '/pages/index/vacancy/vacancy?site=' + uri,
<web-view src="{{site}}"> </web-view>
onLoad: function (options) {
console.log(options)
this.setData({
site: options.site
})
console.log(this.data.site)
},