window.localStorage.removeItem()
时间: 2023-08-30 14:12:56 浏览: 140
vue 界面刷新数据被清除 localStorage的使用详解
window.localStorage.removeItem()是用来删除localStorage中的指定项的方法。可以通过传入要删除的项的键来删除对应的值。例如,使用window.localStorage.removeItem('ceshi1')可以删除localStorage中键为'ceshi1'的项。\[1\]
#### 引用[.reference_title]
- *1* *2* [【学习笔记38】JavaScript中的本地存储](https://blog.csdn.net/m0_58190023/article/details/128058912)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [window.localStorage 增删改查](https://blog.csdn.net/Rainbow1995/article/details/90520264)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文