From 778f3d12b931b024a2dc588594a77438da990ced Mon Sep 17 00:00:00 2001 From: JounQin Date: Wed, 24 Jan 2024 00:02:27 +0800 Subject: [PATCH] chore: document `size` prop --- .editorconfig | 16 ++++++++-------- packages/vue-resizor/README.md | 7 ++++--- packages/vue-resizor/index.md | 7 ++++--- packages/vue-resizor/src/Resizor.tsx | 7 +++++-- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.editorconfig b/.editorconfig index aaaa7a4ba..cc109204d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,10 +1,10 @@ -root = true +root=true [*] -indent_style = space -indent_size = 2 -tab_width = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true +indent_style=space +indent_size=2 +tab_width=2 +end_of_line=lf +charset=utf-8 +trim_trailing_whitespace=true +insert_final_newline=true diff --git a/packages/vue-resizor/README.md b/packages/vue-resizor/README.md index 5585551ca..2e6fa137a 100644 --- a/packages/vue-resizor/README.md +++ b/packages/vue-resizor/README.md @@ -40,9 +40,10 @@ const indicators = ref() ## Available Props -| prop | type (range) | default value | -| ------------ | ------------- | ------------- | -| `indicators` | `Indicator[]` | N/A | +| prop | type (range) | default value | +| ------------ | --------------------------------- | ------------- | +| `indicators` | `Indicator[]` | N/A | +| `size` | `number` (indicator width/height) | `2` | ## Available Events diff --git a/packages/vue-resizor/index.md b/packages/vue-resizor/index.md index 5585551ca..2e6fa137a 100644 --- a/packages/vue-resizor/index.md +++ b/packages/vue-resizor/index.md @@ -40,9 +40,10 @@ const indicators = ref() ## Available Props -| prop | type (range) | default value | -| ------------ | ------------- | ------------- | -| `indicators` | `Indicator[]` | N/A | +| prop | type (range) | default value | +| ------------ | --------------------------------- | ------------- | +| `indicators` | `Indicator[]` | N/A | +| `size` | `number` (indicator width/height) | `2` | ## Available Events diff --git a/packages/vue-resizor/src/Resizor.tsx b/packages/vue-resizor/src/Resizor.tsx index 7b4c84347..057e9bf3d 100644 --- a/packages/vue-resizor/src/Resizor.tsx +++ b/packages/vue-resizor/src/Resizor.tsx @@ -18,7 +18,10 @@ const bem = new Bem('vue-resizor') export default defineComponent({ props: { indicators: Array, - size: Number, + size: { + type: Number, + default: 2, + }, }, setup(props, context) { const slots = context.slots as Required @@ -162,7 +165,7 @@ export default defineComponent({ left, [horizontal ? 'height' : 'width']: '100%', [`border-${horizontal ? 'left' : 'top'}-width`]: pixel( - props.size ?? 2, + props.size, ), }} draggable