企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] #### web-storage-cache 插件用法 * [ ] 文档: [https://www.npmjs.com/package/web-storage-cache](https://www.npmjs.com/package/web-storage-cache) * [ ] 安装:cnpm i -S web-storage-cache * [ ] 基本封装:src / utils / storage ![](https://box.kancloud.cn/4ede5d909cdbb119ceec5b1ad55bea7c_209x165.png) ~~~ // 引入 web-storage-cache 库 import Storage from 'web-storage-cache' // 实例化 const localStorage = new Storage(); // 设置 export function setLocalStorage(key, value) { return localStorage.set(key, value) } // 获取 export function getLocalStorage(key) { return localStorage.get(key) } // 删除 export function removeLocalStorage(key) { return localStorage.delete(key) } // 清空所有 export function clearLocalStorage() { return localStorage.clear() } ~~~