页面请求的url,携带有参数id,如果有多个参数的话,使用&来连接:
上代码:
Page({
/**
* 页面的初始数据
*/
data: {
id: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log("options")
var that = this;
that.setData({
id: options
})
console.log(options)
}
}
控制台输出: