以Promise风格调用: 不支持。
同步获取当前storage的相关信息
属性 | 类型 | 说明 |
---|---|---|
keys | array | 当前 storage 中所有的 key |
currentSize | number | 当前占用的空间大小, 单位 KB |
limitSize | number | 限制的空间大小,单位 KB |
try { const res = xhs.getStorageInfoSync() const data = res.data || res console.log(data.keys) console.log(data.currentSize) console.log(data.limitSize) } catch (e) { // Do something when catch error }