微信小程序页面传值为对象[Object Object]详解

微信小程序页面传值为对象Object Object详解

1、先将传递的对象转化为JSON字符串拼接到url上

javascript 复制代码
 // info为对象
let stationInfo = JSON.stringify(info)
uni.navigateTo({
   url: `/pages/station-detail/station-detail?stationInfo=${stationInfo}`
 })

2、在接受对象页面进行转译

javascript 复制代码
onLoad(options) {
	let stationData = JSON.parse(options.stationInfo)
	console.log(stationData);
},

3、打印结果

相关推荐
衍生星球1 天前
SpringBoot3 + Vue3 + 微信小程序如何学习,以及学哪些技术,组件
sql·微信小程序·uni-app·vue·springboot
weixin_451431561 天前
落地到一个真实项目里——一个 AI驱动的冰箱食材管理小程序
人工智能·ai·小程序
hnxaoli1 天前
统信小程序(十六)xls转xlsx
开发语言·python·小程序
卓怡学长2 天前
w272基于springboot便民医疗服务小程序
java·spring boot·spring·小程序·intellij-idea
新华财经频道2 天前
2026微信小程序搭建平台实测测评,优缺点解析
微信小程序·小程序
kidding7232 天前
旋转大转盘小程序
前端·css·微信小程序·小程序·前端框架
码农客栈2 天前
小程序学习(二十九)之项目打包
小程序
凡科建站3 天前
2026年艺术类教育小程序开发平台有哪些?艺术类教育小程序开发平台推荐
小程序
LT10157974443 天前
2026年在线兼容性测试工具推荐|零部署网页 / APP / 小程序实测对比
测试工具·小程序
码农客栈3 天前
小程序学习(二十八)之“订单列表”
小程序