微信小程序
wx.removeStorage
# wx.removeStorage(Object object)
以 Promise 风格 调用:支持
小程序插件:支持,需要小程序基础库版本不低于 1.9.6
微信 Windows 版:支持
微信 Mac 版:支持
相关文档: 存储策略
# 功能描述
从本地缓存中移除指定 key。
# 参数
# Object object
# 示例代码
wx.removeStorage({
key: 'key',
success (res) {
console.log(res)
}
})
try {
wx.removeStorageSync('key')
} catch (e) {
// Do something when catch error
}