美文网首页
关于小程序的跳转不能携带参数问题

关于小程序的跳转不能携带参数问题

作者: 彭奕茗 | 来源:发表于2019-05-16 21:04 被阅读0次

设置全局变量之后依然不能正常获得数据,

关键在于跳转之后,onLoad()方法并不会重新加载,

需要在前一个页面跳转成功之后对跳转过去的页面设置刷新函数

clickclassify:function(e){

    let that =this    let id = e.currentTarget.dataset.id

    console.log(id)

    app.globalData.classifyId = id

    wx.switchTab({

      url: `/pages/classify/index`,      

            success:function (e) {

        varpage = getCurrentPages().pop();

        if(page == undefined || page ==null)return;

        page.onLoad();

      }

    })

  },

加黑字体

原文链接https://www.cnblogs.com/baifubin/p/9310795.html

相关文章

网友评论

      本文标题:关于小程序的跳转不能携带参数问题

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