错误类型:当参数的值为url的时候,在options中的值没有参数“?”之后字符串被截取。
可以使用encodeURIComponent():函数可把字符串作为 URI 组件进行编码。
let url=encodeURIComponent("http://baidu.com/?a=1&b=2")
wx.navigateTo({
url: `detail?url=${url}`
})
在获取的时候 decodeURIComponent(options.url)即可
错误类型:当参数的值为url的时候,在options中的值没有参数“?”之后字符串被截取。
可以使用encodeURIComponent():函数可把字符串作为 URI 组件进行编码。
let url=encodeURIComponent("http://baidu.com/?a=1&b=2")
wx.navigateTo({
url: `detail?url=${url}`
})
在获取的时候 decodeURIComponent(options.url)即可