// 存储
export const setLocalStorage = (key, data) => {
window.localStorage.setItem(key, JSON.stringify(data))
}
// 获取
export const getLocalStorage = (key) => {
return JSON.parse(window.localStorage.getItem(key))
}
// 删除
export const removeLocalStorage = (key) => {
window.localStorage.removeItem(key)
}
localStorage
最新推荐文章于 2024-07-27 09:25:30 发布