跳转事件
//不带特殊字符参数
jump:function(e){
let array = {
id:1,
name:'张三'
}
wx.navigateTo({
url: '/pages/index/index?array='+JSON.stringify(array),
})
},
//带特殊字符参数
special:function(e){
let array = {
id:1,
name:'/pages/index/index?id=1'
}
wx.navigateTo({
url: '/pages/index/index?array='+encodeURIComponent(JSON.stringify(array)),
})
},
下级页面
onLoad:function(options){
console.log('上级页面参数不带特殊字符',JSON.parse(options.array))
console.log('上级页面参数带特殊字符',JSON.parse(decodeURIComponent(options.array)))
},
遇到问题可以看我主页加我Q,很少看博客,对你有帮助别忘记点赞收藏。