my.removestorage(object object)
小程序开发者工具: 支持。
主体: 企业支付宝小程序 、 个人支付宝小程序
删除本地缓存中的指定 key。
object object
查看示例
属性 | 类型 | 默认值 | 必填 | 描述 |
---|---|---|---|---|
key | string | - | 是 | 缓存数据的 key |
success | function | - | 否 | 调用成功的回调函数 |
fail | function | - | 否 | 调用失败的回调函数 |
complete | function | - | 否 | 调用结束的回调函数(调用成功、失败都会执行) |
fail 回调的参数为 object,error
属性为错误码,errormessage
属性为错误消息。
错误码 | 错误消息 | 凯发app官方网站的解决方案 |
---|---|---|
2 | 接口参数无效。 |
请填写正确的 key 值。 |
代码示例
扫码体验
js 代码
my.removestorage({
key: 'currentcity',
success: res => {
console.log(res);
},
fail: err => {
console.log(err);
}
});