export default {
// 设置
set(name,value) {
return localStorage.setItem(name,JSON.stringify(value))
},
// 获取
get(name) {
return JSON.parse(localStorage.getItem(name))
},
// 清除
clear() {
localStorage.clear()
}
}
封装本地存储方法
于 2023-06-09 16:09:50 首次发布