mpvue传值

//单个值 
detail() {
      const value = this.value;//赋值传值
      wx.navigateTo({ url: "../detail/main?value=" + value });
    }, 
//接收页
onLoad (options) {  
      this.index=options.value
 },
//字符串
detailtwo() {
      const test={
        "time": "2020/05/20 13:14:20",
        "context": "快件在 北京集散中心 [北京市]",
        "Remark": "balala",
        "value": this.value
      };//测试
      const value =JSON.stringify(test)
      wx.navigateTo({ url: "../detailtwo/main?value=" + value });
} 
//接收页
onLoad (options) {  
      //console.log(JSON.parse(options.value))//测试获取值
      const bdata=JSON.parse(options.value)
      this.index=bdata.value
 },

 

posted @ 2020-05-21 16:03  茗涵  阅读(95)  评论(0编辑  收藏  举报