学无先后,达者为师

网站首页 编程语言 正文

小程序页面跳转如何同时传多个参数?

作者:Zan^Z 更新时间: 2022-02-21 编程语言
//跳转页面
  store_xq:function(e){
    let d=e.currentTarget.dataset;
    let url="要跳转的页面地址”
    wx.navigateTo({
      url: 'url?data='+ JSON.stringify(d),
    })
  },
// onLoad接收页面
 onLoad: function (options) {
 	var that=this;
    console.log(options);
    var op = JSON.parse(options.data);
 }

重点是跳转携带的多个参数要加 JSON.stringify转化成字符串,接收页面 JSON.parse再转化成正常使用格式。

原文链接:https://blog.csdn.net/Zan_Z/article/details/112603543

栏目分类
最近更新