操作 | 异步方法 | 同步方法 |
---|---|---|
插入 | wx.setStorage | wx.setStorageSync |
读取 | wx.getStorage | wx.getStorageSync |
删除 | wx.removeStorage | wx.removeStorageSync |
清空 | wx.clearStorage | wx.clearStorageSync |
获取缓存信息 | wx.getStorageInfo | wx.getStorageInfoSync |
以Sync结尾都是同步方法。同步方法和异步方法的区别是:
原文:https://www.cnblogs.com/njccqx/p/12806871.html