美文网首页
7.wx.navigateTo跳转参数为文本

7.wx.navigateTo跳转参数为文本

作者: 指尖架构141319 | 来源:发表于2020-03-12 17:50 被阅读0次
传参会出现文本不全的现象,需要如下处理
  • A页面使用encodeURIComponent编码内容
var value = encodeURIComponent(`http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30`);

wx.navigateTo({
  url: "../video/video?source=" + value,
})

-- B页面使用decodeURIComponent解码

data: {
src_list: null,
},
onLoad: function (options) {
  this.setData({ src_list: decodeURIComponent(options.source)})
}

相关文章

网友评论

      本文标题:7.wx.navigateTo跳转参数为文本

      本文链接:https://www.haomeiwen.com/subject/ecevjhtx.html