diff --git a/packages/components/_private/header/__tests__/__snapshots__/header.spec.ts.snap b/packages/components/_private/header/__tests__/__snapshots__/header.spec.ts.snap
index c526c4a30..a38dc2890 100644
--- a/packages/components/_private/header/__tests__/__snapshots__/header.spec.ts.snap
+++ b/packages/components/_private/header/__tests__/__snapshots__/header.spec.ts.snap
@@ -5,8 +5,7 @@ exports[`Header render work 1`] = `
"
diff --git a/packages/components/button/docs/Index.zh.md b/packages/components/button/docs/Index.zh.md
index ebdc61ad5..5ed076789 100644
--- a/packages/components/button/docs/Index.zh.md
+++ b/packages/components/button/docs/Index.zh.md
@@ -16,15 +16,15 @@ subtitle: 按钮
| 名称 | 说明 | 类型 | 默认值 | 全局配置 | 备注 |
| --- | --- | --- | --- | --- | --- |
-| `mode` | 设置按钮种类 | `'primary' \| 'default' \| 'dashed' \| 'text' \| 'link'` | `'default'` | - |- |
+| `block` | 将按钮宽度调整为自适应其父元素的宽度 | `boolean` | - | - |- |
| `danger` | 设置危险状态 | `boolean` | - | - |- |
-| `ghost` | 设置幽灵状态 | `boolean` | - | - |- |
| `disabled` | 设置禁用状态 | `boolean` | - | - |- |
+| `ghost` | 设置幽灵状态 | `boolean` | - | - |- |
+| `icon` | 设置图标类型 | `string \| #icon` | - | - | `loading` 为 `true` 时无效 |
| `loading` | 设置加载中状态 | `boolean` | - | - |- |
-| `size` | 设置按钮大小 | `'lg' \| 'md' \| 'sm'` | `'md'` | - |- |
+| `mode` | 设置按钮种类 | `'primary' \| 'default' \| 'dashed' \| 'text' \| 'link'` | `'default'` | - |- |
| `shape` | 设置按钮形状 | `'circle' \| 'round'` | - | - |- |
-| `block` | 将按钮宽度调整为自适应其父元素的宽度 | `boolean` | - | - |- |
-| `icon` | 设置图标类型 | `string \| #icon` | - | - | `loading` 为 `true` 时无效 |
+| `size` | 设置按钮大小 | `'lg' \| 'md' \| 'sm'` | `'md'` | - |- |
| `type` | 原生 `button` 的 `type` 属性 | `'button' \| 'submit' \| 'reset'` | `'button'` | - | 参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) |
### IxButtonGroup
@@ -34,7 +34,7 @@ subtitle: 按钮
| 名称 | 说明 | 类型 | 默认值 | 全局配置 | 备注 |
| --- | --- | --- | --- | --- | --- |
| `mode` | 设置组内按钮种类 | `'primary' \| 'default' \| 'dashed' \| 'text' \| 'link'` | - | - |- |
-| `size` | 设置组内按钮大小 | `'lg' \| 'md' \| 'sm'` | - | - |- |
| `shape` | 设置组内按钮形状 | `'circle' \| 'round'` | - | - |- |
+| `size` | 设置组内按钮大小 | `'lg' \| 'md' \| 'sm'` | - | - |- |
### 主题变量
diff --git a/packages/components/button/src/Button.tsx b/packages/components/button/src/Button.tsx
index 3770bf0f5..745e4f513 100644
--- a/packages/components/button/src/Button.tsx
+++ b/packages/components/button/src/Button.tsx
@@ -9,7 +9,6 @@ import type { VNodeTypes } from 'vue'
import { computed, defineComponent, inject, normalizeClass } from 'vue'
-import { hasSlot } from '@idux/cdk/utils'
import { useGlobalConfig } from '@idux/components/config'
import { FORM_TOKEN } from '@idux/components/form'
import { IxIcon } from '@idux/components/icon'
@@ -28,9 +27,8 @@ export default defineComponent({
const formContext = inject(FORM_TOKEN, null)
const mode = computed(() => props.mode ?? groupProps.mode ?? 'default')
- const hasDefaultSlot = computed(() => hasSlot(slots))
-
const size = computed(() => props.size ?? groupProps.size ?? formContext?.size.value ?? 'md')
+
const classes = computed(() => {
const { block, danger, disabled, ghost, loading, icon, shape = groupProps.shape } = props
const prefixCls = mergedPrefixCls.value
@@ -41,7 +39,7 @@ export default defineComponent({
[`${prefixCls}-disabled`]: disabled || loading,
[`${prefixCls}-ghost`]: ghost,
[`${prefixCls}-loading`]: loading,
- [`${prefixCls}-icon-only`]: !hasDefaultSlot.value && (icon || loading),
+ [`${prefixCls}-icon-only`]: !slots.default && (icon || loading),
[`${prefixCls}-${mode.value}`]: mode.value !== 'default',
[`${prefixCls}-${shape}`]: !!shape,
[`${prefixCls}-${size.value}`]: true,
diff --git a/packages/components/button/src/ButtonGroup.tsx b/packages/components/button/src/ButtonGroup.tsx
index f7725372c..d4a5d85cd 100644
--- a/packages/components/button/src/ButtonGroup.tsx
+++ b/packages/components/button/src/ButtonGroup.tsx
@@ -21,6 +21,6 @@ export default defineComponent({
provide(buttonToken, props)
- return () => {slots.default?.()}
+ return () => {slots.default && slots.default()}
},
})
diff --git a/packages/components/collapse/__tests__/__snapshots__/collapse.spec.ts.snap b/packages/components/collapse/__tests__/__snapshots__/collapse.spec.ts.snap
index 52e71b498..c97c7a907 100644
--- a/packages/components/collapse/__tests__/__snapshots__/collapse.spec.ts.snap
+++ b/packages/components/collapse/__tests__/__snapshots__/collapse.spec.ts.snap
@@ -4,8 +4,7 @@ exports[`Collapse panel work header work 1`] = `
"