- 跳转页面传递数组必须序列化
let categoryArr=[1,2,3,4,5]
category = JSON.stringify(categoryArr) //序列化
wx.navigateTo({
url: '../index/index?cate=' + category,
})
- 接受的页面也要序列化
onLoad: function (options) {
this.setData({
category: JSON.parse(options.cate)
})
console.log(this.data.category)
}