feat(projects): 菜单数据及组件接入

This commit is contained in:
Soybean
2021-09-15 07:35:38 +08:00
parent 57e00e6417
commit 3226a724be
25 changed files with 361 additions and 95 deletions

View File

@ -1,12 +1,16 @@
export function setLocal(key: string, value: unknown) {
const json = JSON.stringify(value);
localStorage.setItem(key, json);
window.localStorage.setItem(key, json);
}
export function getLocal<T>(key: string) {
const json = localStorage.getItem(key);
const json = window.localStorage.getItem(key);
if (json) {
return JSON.parse(json) as T;
}
return json;
}
export function removeLocal(key: string) {
window.localStorage.removeItem(key);
}