2019年12月25日

一.数据缓存到本地
1wx.setStorage(object) 异步方式【方法不阻塞】


2.wx.setStorageSync(key,data)同步方式


二.获取本地缓存数据
1.wx.getStorage(object)异步方式获取 需要指定key


2.wx.getStorageSync(object)同步方式获取 需要指定key

3.wx.getStorageInfo(object) 异步获取所有key



4.wx.getStorageInfoSync(objcet)同步 获取所有key

三.移除和清理本地缓存数据
1.wx.removeStorage(object) 异步删除 指定key


2.wx.removeStorageSync(key) 同步删除 指定key

3.清除所有缓存
3.1 wx.clearStorage() 异步清除所有
3.2 wx.clearStorageSync() 同步清除所有

网友评论