web-report/utils/storage.ts
2023-08-21 15:36:10 +08:00

31 lines
612 B
TypeScript

const ArticleCache: {
title: string;
content?: string;
key?: string;
init: boolean;
} = {
title: '',
content: '',
key: '',
init: false
}
export const storage = {
saveTempContent: (content: string, title: string,key?:string) => {
ArticleCache.content = content;
ArticleCache.title = title;
ArticleCache.key = key;
},
getTempContent() {
return ArticleCache;
},
hasInit(){
return ArticleCache.init;
},
// 是否初始化
init(){
// 可以完成一些初始化
ArticleCache.init = true;
}
}