- swan.clearStorage
- 方法参数
- object 参数说明
- 示例
- 图片示例
- 代码示例
- 错误码
- Android
- iOS
- 方法参数
swan.clearStorage
解释:清理本地数据缓存。
方法参数
Object object
object 参数说明
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
|
success |
Function |
否 |
接口调用成功的回调函数 |
|
|
fail |
Function |
否 |
接口调用失败的回调函数 |
|
|
complete |
Function |
否 |
接口调用结束的回调函数(调用成功、失败都会执行) |
示例
跳转编辑工具
在开发者工具中打开
在 WEB IDE 中打开
扫码体验
代码示例
请使用百度APP扫码
图片示例
代码示例
- SWAN
- JS
<view class="wrap"><view class="card-area"><view class="list-area border-bottom"><label class="list-item-key-4">key</label><input class="list-item-value" bindfocus="keyFocus" bindinput="keyInput" type="text" value="{{key}}" placeholder="请输入key" /></view><view class="list-area border-bottom"><label class="list-item-key-4">value</label><input class="list-item-value" bindfocus="valueFocus" bindinput="valueInput" type="text" value="{{value}}" placeholder="请输入value" /></view><view><button bindtap="setStorage" type="primary" hover-stop-propagation="true">存储数据</button><button bindtap="getStorage" type="primary" hover-stop-propagation="true" disabled="{{disabled}}">读取数据</button><button bindtap="getStorageInfo" type="primary" disabled="{{disabled}}">获取存储数据信息</button><button bindtap="clearStorage" type="primary" hover-stop-propagation="true" disabled="{{disabled}}">清理数据</button></view></view></view>
错误码
Android
| 错误码 | 说明 |
|---|---|
|
1001 |
执行失败 |
iOS
| 错误码 | 说明 |
|---|---|
|
401 |
安全校验失败 |


![晴川云Minecraft Wiki教程:初始资源[ ],晴川云](https://baike.qcidc.com/wp-content/uploads/2025/09/20250919082319794-u_3687292352_2261365517fm_253fmt_autoapp_138f_JPEG.jpeg)







暂无评论内容