feat: 添加tocoModals全局变量
This commit is contained in:
3
template/src/global.d.ts
vendored
3
template/src/global.d.ts
vendored
@@ -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 {
|
||||
|
||||
@@ -25,5 +25,6 @@ reportWebVitals();
|
||||
|
||||
// global variables
|
||||
(globalThis as any).tocoRefs = tocoGlobal.getRefs();
|
||||
(globalThis as any).tocoModals = tocoGlobal.getModals();
|
||||
|
||||
export { store };
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user