2018-04-03 14:16:57 +00:00
|
|
|
export default {
|
|
|
|
getItem(key) {
|
2022-06-02 20:19:57 +00:00
|
|
|
var item = window.localStorage.getItem(key);
|
2018-04-03 14:16:57 +00:00
|
|
|
return item && JSON.parse(item);
|
|
|
|
},
|
|
|
|
|
|
|
|
setItem(key, val) {
|
2022-06-02 20:19:57 +00:00
|
|
|
window.localStorage.setItem(key, JSON.stringify(val));
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
removeItem(key) {
|
2022-06-02 20:19:57 +00:00
|
|
|
return window.localStorage.removeItem(key);
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
keys() {
|
2022-06-02 20:19:57 +00:00
|
|
|
return Object.keys(window.localStorage);
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
};
|