feat(space): a11y

This commit is contained in:
07akioni 2021-06-15 01:03:12 +08:00
parent 5905c07276
commit f1812ff90a
3 changed files with 9 additions and 15 deletions

View File

@ -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 `<a />` and `<router-link />` 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.

View File

@ -4,6 +4,7 @@
### Feats
- `n-space` 支持 wai-aria
- `n-button-group` 支持 wai-aria
- `n-progress` 支持 wai-aria
- `n-menu` 支持使用 `<a />``<router-link />` 作为 label关闭 [#84](https://github.com/TuSimple/naive-ui/issues/84)

View File

@ -18,22 +18,13 @@ type Align =
const spaceProps = {
...(useTheme.props as ThemeProps<SpaceTheme>),
align: {
type: String as PropType<Align>,
default: undefined
},
align: String as PropType<Align>,
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 (
<div
role="none"
class={`${mergedClsPrefix}-space`}
style={{
display: inline ? 'inline-flex' : 'flex',
@ -120,6 +112,7 @@ export default defineComponent({
>
{children.map((child, index) => (
<div
role="none"
style={[
itemStyle as any,
{