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)
}

posted @ 2022-04-21 14:55  小杨爱学习!  阅读(4995)  评论(0编辑  收藏  举报