diff --git a/components/collapse/CollapsePanel.vue b/components/collapse/CollapsePanel.vue
index d3edde855..63ff21961 100644
--- a/components/collapse/CollapsePanel.vue
+++ b/components/collapse/CollapsePanel.vue
@@ -21,7 +21,18 @@ export default {
class: collapsePanelClassName,
on: $listeners,
}
- return {this.$slots.default}
+ const { default: defaultSlots, header } = this.$slots
+ return (
+
+ {defaultSlots}
+ {header ? (
+
+ {header}
+
+ ) : null}
+
+
+ )
},
}
diff --git a/components/collapse/demo/custom.md b/components/collapse/demo/custom.md
index 3cad89c05..90cb0be6e 100644
--- a/components/collapse/demo/custom.md
+++ b/components/collapse/demo/custom.md
@@ -12,7 +12,10 @@ Customize the background, border and margin styles for each panel.
-
+
+
+ This is panel header 1
+
{{text}}
diff --git a/components/collapse/src/Panel.vue b/components/collapse/src/Panel.vue
index b2e1be2d0..3334deb02 100644
--- a/components/collapse/src/Panel.vue
+++ b/components/collapse/src/Panel.vue
@@ -36,6 +36,7 @@ export default {
[`${prefixCls}-header`]: true,
[headerClass]: headerClass,
}
+ const headerCon = header || $slots.header
const itemCls = {
[`${prefixCls}-item`]: true,
[`${prefixCls}-item-active`]: isActive,
@@ -50,7 +51,7 @@ export default {
aria-expanded={isActive}
>
{showArrow && }
- {header}
+ {headerCon}