mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-14 14:20:31 +08:00
26 lines
352 B
TypeScript
26 lines
352 B
TypeScript
const MAP = new Map();
|
|
|
|
export const useMultiFrame = () => {
|
|
function setMap(path, Comp) {
|
|
MAP.set(path, Comp);
|
|
}
|
|
|
|
function getMap(path?) {
|
|
if (path) {
|
|
return MAP.get(path);
|
|
}
|
|
return [...MAP.entries()];
|
|
}
|
|
|
|
function delMap(path) {
|
|
MAP.delete(path);
|
|
}
|
|
|
|
return {
|
|
setMap,
|
|
getMap,
|
|
delMap,
|
|
MAP
|
|
};
|
|
};
|