小程序url跳转参数丢失
使用
encodeURIComponent
进行编码然后用decodeURIComponent
解码
// 发送
toShopInfo(e) {
let urlData = JSON.stringify(e.currentTarget.dataset.info);
wx.navigateTo({
url: "/pages/shopInfo/shopInfo?info=" + encodeURIComponent(urlData),
});
},
// 接收
onLoad(options) {
console.log("options:", decodeURIComponent(options.info));
},
标签:info,url,shopInfo,丢失,跳转,options
From: https://www.cnblogs.com/zero-clown/p/little-program-url-jump-parameter-loss-z2jgzwi.html