比如从index。wxml跳转到aaa.wxml
index.wml
<navigator url="../aaa/aaa?id=1" > </navigator>
传到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)
}
})