微信小程序api视频课程-数据缓存-wx.getStorageInfo 获取当前storage的相关信息的使用

微信小程序api视频课程-数据缓存-wx.getStorageInfo 获取当前storage的相关信息的使用

wxml代码

wx.getStorageInfo(Object object) 
异步获取当前storage的相关信息

<button bindtap="myget01">获取当前storage的相关信息</button>

js代码

  /**
   * 页面的初始数据
   */
  data: {

  },
  myget01:function(){
    wx.getStorageInfo({
      success: function(res) {
        console.log("当前所有的key:"+res.keys)
        console.log("当前占用的空间大小, 单位 KB:" + res.currentSize)
        console.log("限制的空间大小,单位 KB:" + res.limitSize)
      },
    })
  },

欢迎大家收看我的****:微信小程序常用API使用
微信小程序api视频课程-数据缓存-wx.getStorageInfo 获取当前storage的相关信息的使用