页面跳转时,携带参数url中问号后的部分链接被自动截断

发布于 7 年前作者 liaojing13622 次浏览最后编辑 7 年前来自 ask
  • 当前 Bug 的表现(可附上截图)
  • 预期表现

  • 复现路径

  • 提供一个最简复现 Demo

onTap:function(e) {

            console.log(e.currentTarget.dataset.url)

            let a = e.currentTarget.dataset

            wx.navigateTo({

                url: `/pages/reading/detail/detail?url=${e.currentTarget.dataset.url}`,

            })

        }

onLoad: function (options) {

      console.log(options)

      let url = options.url

 

      console.log(options.url)

 

},

2 回复
qiangzheng
qiangzheng1 楼6 年前

url参数内容先encodeURIComponent再传值,收到参数后decodeURIComponent就是了。

luochao
luochao2 楼5 年前

你输出一下${e.currentTarget.dataset.url}`,看看会不会报错