From 49f95c4e4512fc0e7e4de089a7b22764597525db Mon Sep 17 00:00:00 2001 From: Soybean Date: Mon, 22 Aug 2022 23:34:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(projects):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/context/demo.ts | 4 ++-- src/hooks/business/useNaiveTable.ts | 1 - src/hooks/common/useContext.ts | 1 + src/typings/package.d.ts | 14 -------------- tsconfig.json | 2 +- 6 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 src/hooks/business/useNaiveTable.ts diff --git a/README.md b/README.md index 628dd1cbf..b24458e83 100644 --- a/README.md +++ b/README.md @@ -71,12 +71,12 @@ - [x] 图表示例:ECharts、AntV G2 - [x] 多页签:支持 query、hash 等参数,同一页面支持多个 Tab - [x] 缓存主题配置 +- [x] 精简版(新分支 thin) - [ ] v0.9.7 表单、表格示例(ing...) - [ ] v0.9.8 可修改的 KeepAlive 的页面缓存和全局 Tab 组件 store 重构 - [ ] v0.9.9 全局 Iframe 组件 - [ ] v1.0 示例页面完善 - [ ] v1.0 版本文档 -- [ ] 精简版(新分支 thin) - [ ] element-plus 版本 - [ ] i18n 国际化 - [ ] 其他 UI 版本 diff --git a/src/context/demo.ts b/src/context/demo.ts index 71f21af51..c7bc056b0 100644 --- a/src/context/demo.ts +++ b/src/context/demo.ts @@ -22,7 +22,7 @@ export function useDemoContext() { }; function useProvide() { - useDemoProvide(demoContext); + return useDemoProvide(demoContext); } return { @@ -35,7 +35,7 @@ export function useDemoContext() { // A.vue // import { useDemoContext } from '@/context'; // const { useProvide } = useDemoContext(); -// useProvide(); +// const { counts, setCounts } = useProvide(); // B.vue 和 C.vue : 共享状态 counts // import { useDemoContext } from '@/context'; diff --git a/src/hooks/business/useNaiveTable.ts b/src/hooks/business/useNaiveTable.ts deleted file mode 100644 index 68e3f65c6..000000000 --- a/src/hooks/business/useNaiveTable.ts +++ /dev/null @@ -1 +0,0 @@ -// import type { DataTableColumn } from 'naive-ui'; diff --git a/src/hooks/common/useContext.ts b/src/hooks/common/useContext.ts index 069631091..d5dd0df70 100644 --- a/src/hooks/common/useContext.ts +++ b/src/hooks/common/useContext.ts @@ -7,6 +7,7 @@ export default function useContext(contextName = 'context') { function useProvide(context: T) { provide(injectKey, context); + return context; } function useInject() { diff --git a/src/typings/package.d.ts b/src/typings/package.d.ts index e6bc1183d..c0a75af11 100644 --- a/src/typings/package.d.ts +++ b/src/typings/package.d.ts @@ -1,4 +1,3 @@ -/// /// /// @@ -8,16 +7,3 @@ declare namespace BMap { } declare const TMap: any; - -declare module 'virtual:icons/*' { - import type { FunctionalComponent, SVGAttributes } from 'vue'; - - const component: FunctionalComponent; - export default component; -} -declare module '~icons/*' { - import type { FunctionalComponent, SVGAttributes } from 'vue'; - - const component: FunctionalComponent; - export default component; -} diff --git a/tsconfig.json b/tsconfig.json index 1b46d3137..69b8abaae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,7 @@ "~/*": ["./*"], "@/*": ["./src/*"] }, - "types": ["node", "naive-ui/volar", "unplugin-vue-define-options"] + "types": ["vite/client", "node", "unplugin-icons/types/vue", "naive-ui/volar", "unplugin-vue-define-options"] }, "exclude": ["node_modules", "dist"] }