美文网首页
微信小程序系列-值的传递

微信小程序系列-值的传递

作者: 囝囝123 | 来源:发表于2019-05-17 15:55 被阅读0次

页面间传值

1.这种类似于a 标签,页面可以直接跳转

     <navigator class="sign_allow_nodingwei" url='../calendar_main/calendar_map/calendar_map?index={{index_current}}'> 不在考勤范围内,查看考前范围</navigator>

2.定义方法

 //查看地图定位
  // toMAP: function (index) {
  //   wx.navigateTo({
  //     url: '../calendar_main/calendar_map/calendar_map?index='+index,
  //   })
  // },

页面接收值

1.接收页面传递的值

 /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    that.setData({
      index: options.index
    })
  }

2.使用参数的值

var index_current = this.data.index;

相关文章

网友评论

      本文标题:微信小程序系列-值的传递

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