From f1812ff90a05aee4a42d347a6d09c33b67acbbae Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Tue, 15 Jun 2021 01:03:12 +0800 Subject: [PATCH] feat(space): a11y --- CHANGELOG.en-US.md | 6 +++--- CHANGELOG.zh-CN.md | 1 + src/space/src/Space.tsx | 17 +++++------------ 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index fbab12526..2523b31d4 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -4,9 +4,9 @@ ### Feats - -- `n-button-group` supports wai-aria -- `n-progress` supports wai-aria +- `n-space` supports wai-aria. +- `n-button-group` supports wai-aria. +- `n-progress` supports wai-aria. - `n-menu` supports use `` and `` as label, closes [#84](https://github.com/TuSimple/naive-ui/issues/84). - `n-input-number` add `show-button` prop. - `n-rate` support `default` slot for icon customizing. diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 356035c9f..aa7ea84e5 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -4,6 +4,7 @@ ### Feats +- `n-space` 支持 wai-aria - `n-button-group` 支持 wai-aria - `n-progress` 支持 wai-aria - `n-menu` 支持使用 `` 和 `` 作为 label,关闭 [#84](https://github.com/TuSimple/naive-ui/issues/84) diff --git a/src/space/src/Space.tsx b/src/space/src/Space.tsx index c3fee98e0..72ddd0607 100644 --- a/src/space/src/Space.tsx +++ b/src/space/src/Space.tsx @@ -18,22 +18,13 @@ type Align = const spaceProps = { ...(useTheme.props as ThemeProps), - align: { - type: String as PropType, - default: undefined - }, + align: String as PropType, justify: { type: String as PropType<'start' | 'end'>, default: 'start' }, - inline: { - type: Boolean, - default: false - }, - vertical: { - type: Boolean, - default: false - }, + inline: Boolean, + vertical: Boolean, size: { type: [String, Number, Array] as PropType< 'small' | 'medium' | 'large' | number | [number, number] @@ -107,6 +98,7 @@ export default defineComponent({ const lastIndex = children.length - 1 return ( {children.map((child, index) => (