码迷,mamicode.com
首页 > 其他好文 > 详细

小程序-页面跳转传值的方法

时间:2017-11-16 17:20:39      阅读:99      评论:0      收藏:0      [点我收藏+]

标签:style   alt   url   方法   bsp   页面   nav   获取   nload   

比如从index。wxml跳转到aaa.wxml

 

index.wml页面

<navigator url = "../aaa/aaa?id=1" ></navidator>  //传到aaa。wxml的时候传过去的值为id=1,则需要在aaa.wxml 的js获取到id=1

 

aaa.js页面

Page({

 data: {

     id:‘‘

  },

 onLoad: function (options){

    var that = this;

    that.setData({

       id: options.id

    })

    console.log(that.data.id)

  }

})

小程序-页面跳转传值的方法

标签:style   alt   url   方法   bsp   页面   nav   获取   nload   

原文地址:http://www.cnblogs.com/liuqingxia/p/7844990.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!