当前位置:网站首页>When the uniapp page jumps with complex data parameters.

When the uniapp page jumps with complex data parameters.

2022-06-12 08:39:00 Pumpkin_ xiaoXuan

 1. The parent page should first convert the data into JSON.stringify Format , Re pass parameters encodeURIComponent() Method code

 //  Comment on the list 
      goEvaluate() {
        let JSONProductList = JSON.stringify(this.orderInfo.productList)
        uni.navigateTo({
          url: `/pages/product/evaluate?orderId=${this.orderId}&orderList=${encodeURIComponent(JSONProductList)}`
        })
      },

2. For sub pages JSON.parse Transformation format , Reuse decodeURIComponent() Method code .

onLoad(options) {
      var orderData = JSON.parse(decodeURIComponent(options.orderList))
    },

原网站

版权声明
本文为[Pumpkin_ xiaoXuan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203010547586729.html