请问怎么用wx.navigateTo传递对象类型的数据?

小程序 文章 2020-08-24 09:21 696 0 全屏看文

AI助手支持GPT4.0

请问怎么用wx.navigateTo传递对象类型的数据?How to use wx.navigateTo to pass object type data?

请问怎么用wx.navigateTo传递对象类型的数据?

比如图片中的room_info

使用wx.navigateTo传递到另一个页面之后,数据就变成了下面这个样子

请问怎么解决?


For example, room in the picture_ Info usage wx.navigateTo After it is transferred to another page, the data will become the following. How can I solve this problem?

回答:

?:

前面你传递的时候用JSON.stringify()包起来,在接受页面用JSON.parse()再转换回来就行了


listen:多谢!成功解决!
追风少年:

你这个是不是就是打印的问题?

listen:我是setData后在AppData上面看的。
老张:

event channel

-EOF-

AI助手支持GPT4.0