# Object wx.getStorageInfoSync()
with Promise style call: Supported
Mini Program plugin: Not supported
wx.getStorageInfo The synchronous version of
# Return value
# Object object
attribute | type | Introductions |
---|---|---|
keys | Array.<string> | Current storage All of the key |
currentSize | number | The current amount of space occupied, unit KB |
limitSize | number | Limited space size, unit KB |
# sample code
wx.getStorageInfo({
success (res) {
console.log(res.keys)
console.log(res.currentSize)
console.log(res.limitSize)
}
})
try {
const res = wx.getStorageInfoSync()
console.log(res.keys)
console.log(res.currentSize)
console.log(res.limitSize)
} catch (and) {
// From the something when catch error
}
The translations are provided by WeChat Translation and are for reference only. In case of any inconsistency and discrepancy between the Chinese version and the English version, the Chinese version shall prevail.Incorrect translation. Tap to report.