1
0
mirror of synced 2026-04-05 07:48:35 +08:00

feat(editor): 参考线缓存与页面绑定

This commit is contained in:
roymondchen
2022-06-22 16:05:12 +08:00
committed by jia000
parent 363330e07a
commit fb612eaddc
8 changed files with 78 additions and 58 deletions

View File

@@ -204,3 +204,18 @@ export const Fixed2Other = async (
return toRelative(node);
};
export const getGuideLineFromCache = (key: string): number[] => {
if (!key) return [];
const guideLineCacheData = globalThis.localStorage.getItem(key);
if (guideLineCacheData) {
try {
return JSON.parse(guideLineCacheData) || [];
} catch (e) {
console.error(e);
}
}
return [];
};