Detailed Explanation of WeChat Mini Program Page Passing Value as Object [Object Object]

Detailed Explanation of WeChat Mini Program Page Passing Value as Object [Object Object]

1. First convert the passed object into a JSON string and splicing it to the url

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

2. Translate on the accept object page

onLoad(options) {
    
    
	let stationData = JSON.parse(options.stationInfo)
	console.log(stationData);
},

3. Print the result

insert image description here

Guess you like

Origin blog.csdn.net/DZQ1223/article/details/132046755