feat: 添加tocoModals全局变量

This commit is contained in:
dayjoy
2024-10-15 16:45:23 +08:00
parent f2a210ed29
commit 7d89ea3eb6
7 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
import { ModalRef } from '@df/toco-ui';
declare global {
let tocoRefs: Record<string, any>;
let tocoModals: Record<string, ModalRef<any>>;
}
interface Meta {

View File

@@ -25,5 +25,6 @@ reportWebVitals();
// global variables
(globalThis as any).tocoRefs = tocoGlobal.getRefs();
(globalThis as any).tocoModals = tocoGlobal.getModals();
export { store };

View File

@@ -14,6 +14,7 @@ const Test = (props) => {
console.log('store', tocoStore);
console.log('services', tocoServices);
console.log('refs', tocoRefs);
console.log('modals', tocoModals);
}, [navigate, props, tocoStore]);
return (