Page({ data:{ itemList: [] }, onLoad:function(options){ // 页面初始化 options为页面跳转所带来的参数 }, onReady:function(){ // 页面渲染完成 }, onShow:function(){ // 页面显示 var configs=wx.getStorageSync('configs');//得到缓存 var itemList=[]; for(var i in configs){ var config=configs[i]; if(config.state){ itemList.push(config.name) } } this.setData({itemList:itemList})//我遇到的问题是怎么把itemList数组放到弹窗中的呢,如果把 this.setData({itemList:itemList})放进去直接报错。 }, onHide:function(){ // 页面隐藏 }, onUnload:function(){ // 页面关闭 }, //单击事件 actionSheetTap:function(){ wx.showActionSheet({ itemList: [],//弹窗 success: function(res) { if (!res.cancel) { console.log(res.tapIndex) } }})}})
添加回答
举报
0/150
提交
取消