From 67400ee2ec4e7facb7aa80107e7a645dfcccee4f Mon Sep 17 00:00:00 2001 From: CyanSalt Date: Wed, 28 Jun 2023 20:00:39 +0800 Subject: [PATCH] feat: add details --- docs/.vitepress/config.ts | 5 +- docs/components/button.md | 90 ++++++++++++++++++++------- docs/components/details.md | 114 ++++++++++++++++++++++++++++++++++ docs/components/graphics.md | 0 docs/components/grid-guide.md | 31 ++++++--- docs/components/link.md | 20 +++++- docs/components/space.md | 49 ++++++++++++--- docs/components/table.md | 60 ++++++++++++++---- docs/components/text.md | 28 +++++++-- src/button/index.vue | 12 ++-- src/components.ts | 1 + src/details/index.vue | 89 ++++++++++++++++++++++++++ src/graphics/index.vue | 6 +- src/grid-guide/index.vue | 10 ++- src/link/index.vue | 4 +- src/space/index.vue | 10 +-- src/table/index.vue | 9 ++- src/text/index.vue | 4 +- 18 files changed, 448 insertions(+), 94 deletions(-) create mode 100644 docs/components/details.md create mode 100644 docs/components/graphics.md create mode 100644 src/details/index.vue diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 8335277..1fab011 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -26,6 +26,7 @@ export default defineConfig({ text: 'Basic', items: [ { text: 'Button', link: '/components/button' }, + { text: 'Details', link: '/components/details' }, { text: 'Grid Guide', link: '/components/grid-guide' }, { text: 'Link', link: '/components/link' }, { text: 'Space', link: '/components/space' }, @@ -51,10 +52,6 @@ export default defineConfig({ text: 'Feedback', items: [], }, - { - text: 'Configuration', - items: [], - }, ], }, ], diff --git a/docs/components/button.md b/docs/components/button.md index 3868b2a..8f6dc09 100644 --- a/docs/components/button.md +++ b/docs/components/button.md @@ -1,5 +1,5 @@ # Button @@ -10,6 +10,9 @@ Squares are buttons. ### Basic + + + ```vue ``` - + + + Switch Account Log out of Chaos ### Tag + + + ```vue + +# Details + +The devil is in the details. + +## Example + + + + +```vue + + + +``` + + + + + + + Clown suits + + Closet Door + + +## Usage + +### Props + + + + + + + + + + +### Events + + + + + + + + + +### Slots + + + + + + + + diff --git a/docs/components/graphics.md b/docs/components/graphics.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/components/grid-guide.md b/docs/components/grid-guide.md index 3b1c60e..4b772b7 100644 --- a/docs/components/grid-guide.md +++ b/docs/components/grid-guide.md @@ -1,5 +1,5 @@ # Grid Guide @@ -8,6 +8,9 @@ Guide lines are always straight. ## Example + + + ```vue # Link @@ -10,6 +10,9 @@ The blood moon rises once again. Please be careful, Link... ### Basic + + + ```vue # Space @@ -10,6 +10,9 @@ We need to keep our distance. ### Basic + + + ```vue # Table @@ -10,6 +10,9 @@ Tic, tac, toe. ### Basic + + + ```vue # Text @@ -10,6 +10,9 @@ The secret of being boring is to say everything. ### Basic + + + ```vue + + + + diff --git a/src/graphics/index.vue b/src/graphics/index.vue index 41f41bf..727e113 100644 --- a/src/graphics/index.vue +++ b/src/graphics/index.vue @@ -10,17 +10,15 @@ defineOptions({ }) const { - ctx, responsive = true, tag = 'svg', } = defineProps<{ - ctx?: any, responsive?: boolean, tag?: T, }>() const emit = defineEmits<{ - (event: 'draw', rc: T extends 'canvas' ? RoughCanvas : RoughSVG, svg: T extends 'canvas' ? HTMLCanvasElement : SVGSVGElement, ctx: any): void, + (event: 'draw', rc: T extends 'canvas' ? RoughCanvas : RoughSVG, svg: T extends 'canvas' ? HTMLCanvasElement : SVGSVGElement): void, }>() const parent = $(useParentElement()) @@ -57,7 +55,7 @@ watchEffect(() => { } else { root.innerHTML = '' } - emit('draw', rc, root, ctx) + emit('draw', rc, root) }) diff --git a/src/grid-guide/index.vue b/src/grid-guide/index.vue index bfa2681..57ad205 100644 --- a/src/grid-guide/index.vue +++ b/src/grid-guide/index.vue @@ -90,13 +90,8 @@ watchEffect(() => {