Skip to content

Commit c36f435

Browse files
committed
feat: update collapse
1 parent e1cd139 commit c36f435

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

components/collapse/Collapse.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import animation from '../_util/openAnimation'
22
import { getOptionProps, initDefaultProps } from '../_util/props-util'
33
import VcCollapse, { collapseProps } from '../vc-collapse'
4-
4+
import Icon from '../icon'
55
export default {
66
name: 'ACollapse',
77
model: {
@@ -13,6 +13,13 @@ export default {
1313
bordered: true,
1414
openAnimation: animation,
1515
}),
16+
methods: {
17+
renderExpandIcon () {
18+
return (
19+
<Icon type='right' class='arrow' />
20+
)
21+
},
22+
},
1623
render () {
1724
const { prefixCls, bordered, $listeners } = this
1825
const collapseClassName = {
@@ -21,6 +28,7 @@ export default {
2128
const rcCollapeProps = {
2229
props: {
2330
...getOptionProps(this),
31+
expandIcon: this.renderExpandIcon,
2432
},
2533
class: collapseClassName,
2634
on: $listeners,

components/vc-collapse/src/Panel.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default {
5757
}
5858
let icon = null
5959
if (showArrow && typeof expandIcon === 'function') {
60-
icon = cloneElement(expandIcon, { ...this.$props })
60+
icon = cloneElement(expandIcon(this.$props))
6161
}
6262
return (
6363
<div class={itemCls} role='tablist'>

0 commit comments

Comments
 (0)