1.在跳转前的页面对需要传递的参数使用encodeURIComponent()进行编码
let data = JSON.stringify(item)
Taro.navigateTo({
url: 跳转后的地址?data=${encodeURIComponent(data)}
})
2.在跳转后的页面对需要获取到的参数使用decodeURIComponent()进行解码
let data = JSON.parse(decodeURIComponent(Current.router.params.data))
版权声明:本文为s3mple原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。