mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-17 15:50:35 +08:00
release: update 5.5.0
This commit is contained in:
25
src/layout/hooks/useMultiFrame.ts
Normal file
25
src/layout/hooks/useMultiFrame.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user