wx.navigateTo 跳转新页面onLoad截取

小程序 文章 2021-01-22 23:01 446 0 全屏看文

AI助手支持GPT4.0

wx.navigateTo 跳转新页面onLoad截取wx.navigateTo jump to a new page onLoad interception

wx.navigateTo 跳转新页面onLoad截取
框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.navigateTo,onLoad 工具 7.0 2.14

wx.navigateTo({

      url: '../test/index?a={"name":"xxxxx=222222"}',

    })

navigateTo 跳转url 参数为json,并且对象中的value 有 ‘=’号,在新页面的OnLoad 函数 会自动截取掉 =号后面的值


Framework type problem type API / component name terminal type wechat version basic library version applet bug wx.navigateTo , onload tool 7.0 2.14 wx.navigateTo ({URL: '/ / test / index? A = {"name": "xxxxx = 222222"}},}) the navigateto jump URL parameter is JSON, and the value in the object has the' = 'sign. The onload function of the new page will automatically intercept the value after the = sign Code snippet https://developers.weixin.qq.com/s/4zevtymE7nnk

回答:

brave:
var data = {  name: "xxxxx=22222"}wx.navigateTo({  url: "../test/index?a=" + JSON.stringify(data)})
恒:

传json字符串,跳转后格式化一下不就好了吗

刘晓兵:

@管方


-EOF-

AI助手支持GPT4.0