关于微信小程序弹窗问题。

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)

    }

  }

})


}

})


繁花如伊
浏览 955回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript