From dd8f37181a266054f296c1f7d6825afd7eefed49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Sun, 24 Oct 2021 23:41:19 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20use=20=E4=B8=BA=20?= =?UTF-8?q?hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/zh-CN/components/switch.md | 2 +- docs/docs/zh-CN/guide/norms.md | 2 ++ docs/src/router/zh-CN.ts | 5 +++++ docs/src/view/guide.vue | 6 ++++++ src/{use => hooks}/index.ts | 0 src/{use => hooks}/useClickOutside.ts | 0 src/{use => hooks}/usePosition.ts | 0 src/module/colorPicker/ColorBox.vue | 2 +- src/module/dropdown/index.vue | 2 +- src/module/select/index.vue | 2 +- src/module/tab/index.vue | 18 ++++++++---------- src/module/tabItem/index.vue | 4 +++- 12 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 docs/docs/zh-CN/guide/norms.md rename src/{use => hooks}/index.ts (100%) rename src/{use => hooks}/useClickOutside.ts (100%) rename src/{use => hooks}/usePosition.ts (100%) diff --git a/docs/docs/zh-CN/components/switch.md b/docs/docs/zh-CN/components/switch.md index 67d3ee99..8c8088c4 100644 --- a/docs/docs/zh-CN/components/switch.md +++ b/docs/docs/zh-CN/components/switch.md @@ -112,7 +112,7 @@ export default { ::: | Name | Description | Accepted Values | -| ------------- | -------------- | ---------------- | ------------ | +| ------------- | -------------- | ---------------- | | name | 原生 name 属性 | -- | | v-model | 是否启用 | `true` `false` | | disabled | 禁用 | `true` `false` | diff --git a/docs/docs/zh-CN/guide/norms.md b/docs/docs/zh-CN/guide/norms.md new file mode 100644 index 00000000..a29453a4 --- /dev/null +++ b/docs/docs/zh-CN/guide/norms.md @@ -0,0 +1,2 @@ +::: field 开发规范 +::: diff --git a/docs/src/router/zh-CN.ts b/docs/src/router/zh-CN.ts index 36e5e9e5..ed65b356 100644 --- a/docs/src/router/zh-CN.ts +++ b/docs/src/router/zh-CN.ts @@ -46,6 +46,11 @@ const zhCN = [ component: () => import('../../docs/zh-CN/guide/contribution.md'), meta: { title: '贡献' }, }, + { + path: '/zh-CN/guide/norms', + component: () => import('../../docs/zh-CN/guide/norms.md'), + meta: { title: '规范' }, + }, ], }, { diff --git a/docs/src/view/guide.vue b/docs/src/view/guide.vue index f9a86465..f671eda5 100644 --- a/docs/src/view/guide.vue +++ b/docs/src/view/guide.vue @@ -86,6 +86,12 @@ export default { subTitle: 'change log', path: '/zh-CN/guide/changelog', }, + { + id: 6, + title: '规范', + subTitle: 'norms', + path: '/zh-CN/guide/norms', + }, { id: 4, title: '问题', diff --git a/src/use/index.ts b/src/hooks/index.ts similarity index 100% rename from src/use/index.ts rename to src/hooks/index.ts diff --git a/src/use/useClickOutside.ts b/src/hooks/useClickOutside.ts similarity index 100% rename from src/use/useClickOutside.ts rename to src/hooks/useClickOutside.ts diff --git a/src/use/usePosition.ts b/src/hooks/usePosition.ts similarity index 100% rename from src/use/usePosition.ts rename to src/hooks/usePosition.ts diff --git a/src/module/colorPicker/ColorBox.vue b/src/module/colorPicker/ColorBox.vue index 5798ee91..1f48a109 100644 --- a/src/module/colorPicker/ColorBox.vue +++ b/src/module/colorPicker/ColorBox.vue @@ -8,7 +8,7 @@ import { Nullable } from '/@src/module/type' import { computed, onMounted, ref } from 'vue' import { HSBToHEX, RGBSTo, RGBToHSB } from '/@src/module/colorPicker/colorUtil' import ColorPicker from './ColorPicker.vue' -import { usePosition } from '/@src/use/usePosition' +import { usePosition } from '/@src/hooks/usePosition' interface BoxProps { color?: string diff --git a/src/module/dropdown/index.vue b/src/module/dropdown/index.vue index 106a4fd2..2f193f35 100644 --- a/src/module/dropdown/index.vue +++ b/src/module/dropdown/index.vue @@ -32,7 +32,7 @@ diff --git a/src/module/tabItem/index.vue b/src/module/tabItem/index.vue index 51121290..2a17df41 100644 --- a/src/module/tabItem/index.vue +++ b/src/module/tabItem/index.vue @@ -11,13 +11,15 @@ export default {