diff --git a/template/.eslintrc.js b/template/.eslintrc.js index 34d237c..3ef8655 100644 --- a/template/.eslintrc.js +++ b/template/.eslintrc.js @@ -40,5 +40,6 @@ module.exports = { ], globals: { tocoRefs: true, + tocoModals: true, }, }; diff --git a/template/README.md b/template/README.md index 5e7cbf8..bd82114 100644 --- a/template/README.md +++ b/template/README.md @@ -59,6 +59,7 @@ interface Meta { tocoStore:全局 store tocoServices:页面的请求 tocoRefs:页面上所有带 id 组件的 refs + tocoModals:页面上所有带 id 弹窗的 refs ``` ## 目录结构 diff --git a/template/package.json b/template/package.json index 8121e1d..30c7acf 100644 --- a/template/package.json +++ b/template/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@ant-design/icons": "^5.3.4", - "@df/toco-ui": "^0.1.11", + "@df/toco-ui": "{{uiVersion}}", "@reduxjs/toolkit": "^1.9.7", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", diff --git a/template/src/global.d.ts b/template/src/global.d.ts index 4244ef3..26cad10 100644 --- a/template/src/global.d.ts +++ b/template/src/global.d.ts @@ -1,5 +1,8 @@ +import { ModalRef } from '@df/toco-ui'; + declare global { let tocoRefs: Record; + let tocoModals: Record>; } interface Meta { diff --git a/template/src/index.tsx b/template/src/index.tsx index 8207eb8..6f04ef1 100644 --- a/template/src/index.tsx +++ b/template/src/index.tsx @@ -25,5 +25,6 @@ reportWebVitals(); // global variables (globalThis as any).tocoRefs = tocoGlobal.getRefs(); +(globalThis as any).tocoModals = tocoGlobal.getModals(); export { store }; diff --git a/template/src/pages/test/Test.js b/template/src/pages/test/Test.js index 7e918fd..58509dd 100644 --- a/template/src/pages/test/Test.js +++ b/template/src/pages/test/Test.js @@ -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 ( diff --git a/values.yml b/values.yml index 36bce2f..a96c720 100644 --- a/values.yml +++ b/values.yml @@ -1 +1,2 @@ -projectName: toco \ No newline at end of file +projectName: toco +uiVersion: 0.1.36 \ No newline at end of file