# 清除存储数据 this.removeStorage(key)
用于临时保存数据,将数据写入本地缓存
| 参数名 | 类型 | 必填 | 说明|
| --- | --- |--- | --- |
| key | string | 是 | 本地缓存中的指定的 key |
示例
```
async mounted() {
let myData ={
name : '小明'
}
this.setStorage('myData',myData)
//获取存储数据
let data = this.getStorage('myData')
console.log(data)
//清除数据
this.removeStorage('myData')
}
```
# 清除全部存储数据 this.removeAllStorage()
用于临时保存数据,将数据写入本地缓存
| 参数名 | 类型 | 必填 | 说明|
| --- | --- |--- | --- |
| key | string | 是 | 本地缓存中的指定的 key |
示例
```
async mounted() {
let myData ={
name : '小明'
}
this.setStorage('myData',myData)
//获取存储数据
let data = this.getStorage('myData')
console.log(data)
//清除全部key的数据
this.removeAllStorage()
}
```