uni-app 跳转页面传递多个参数
uniapp页面跳转传递多个参数
1.字符串拼接
record(){
uni.navigateTo({
url: '/pages/record/detail?id=' + this.list.holderId + '&code=' + this.list.code + '&name=' + this.list.name
});
},
2.传递对象,需先转成字符串,接收时候再转成对象
向子页面传递
uni.navigateTo({
url: '/pages/index/index?myData=' + encodeURIComponent(JSON.stringify(row))
})
子页面接收
onLoad(option) {
const myData = JSON.parse(decodeURIComponent(option.myData))
console.log(myData)
}