feat: add space

This commit is contained in:
2023-04-17 08:08:22 +08:00
parent e5896c093a
commit 27f2980768
11 changed files with 431 additions and 52 deletions

View File

@ -53,9 +53,13 @@ const Button = defineComponent({
direction
)
const sizeCls = computed(() => {
const sizeClassNameMap = { large: 'lg', small: 'sm', middle: undefined }
const sizeClassNameMap: Record<string, any> = {
large: 'lg',
small: 'sm',
middle: undefined
}
const sizeFullname = compactSize?.value || size.value
return sizeClassNameMap[sizeFullname!]
return sizeClassNameMap[sizeFullname]
})
const disabled = useDisabled(props)
const buttonRef = shallowRef<HTMLButtonElement | null>(null)

View File

@ -14,12 +14,12 @@ title: Type
There are `primary` button, `default` button, `dashed` button, `text` button and `link` button in antd.
</docs>
<script setup lang="ts"></script>
<template>
<a-button type="primary">Primary Button</a-button>
<a-button>Default Button</a-button>
<a-button type="dashed">Dashed Button</a-button>
<a-button type="text">Text Button</a-button>
<a-button type="link">Link Button</a-button>
<a-space wrap>
<a-button type="primary">Primary Button</a-button>
<a-button>Default Button</a-button>
<a-button type="dashed">Dashed Button</a-button>
<a-button type="text">Text Button</a-button>
<a-button type="link">Link Button</a-button>
</a-space>
</template>

View File

@ -49,7 +49,6 @@ It accepts all props which native buttons support.
## Design Token
<ComponentTokenTable component="Button"></ComponentTokenTable>
## FAQ

View File

@ -54,7 +54,6 @@
## Design Token
<ComponentTokenTable component="Button"></ComponentTokenTable>
## FAQ