let query = {url: ''}
wx.navigateTo({
url: `/pages/detail/main?query=` + encodeURIComponent(JSON.stringify(query))
})
複製代碼
onLoad(options) {
console.log(JSON.parse(decodeURIComponent(options.query))) //打印時不能帶提示
let query = JSON.parse(decodeURIComponent(options.query))
this.url = query.url
}
複製代碼