From 7d89ea3eb6fa3a6d29190c09ced82ec2d340d8cd Mon Sep 17 00:00:00 2001 From: dayjoy Date: Tue, 15 Oct 2024 16:45:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0tocoModals=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/.eslintrc.js | 1 + template/README.md | 1 + template/package.json | 2 +- template/src/global.d.ts | 3 +++ template/src/index.tsx | 1 + template/src/pages/test/Test.js | 1 + values.yml | 3 ++- 7 files changed, 10 insertions(+), 2 deletions(-) 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