feat: update collapse
parent
e1cd139e8b
commit
c36f435769
|
@ -1,7 +1,7 @@
|
|||
import animation from '../_util/openAnimation'
|
||||
import { getOptionProps, initDefaultProps } from '../_util/props-util'
|
||||
import VcCollapse, { collapseProps } from '../vc-collapse'
|
||||
|
||||
import Icon from '../icon'
|
||||
export default {
|
||||
name: 'ACollapse',
|
||||
model: {
|
||||
|
@ -13,6 +13,13 @@ export default {
|
|||
bordered: true,
|
||||
openAnimation: animation,
|
||||
}),
|
||||
methods: {
|
||||
renderExpandIcon () {
|
||||
return (
|
||||
<Icon type='right' class='arrow' />
|
||||
)
|
||||
},
|
||||
},
|
||||
render () {
|
||||
const { prefixCls, bordered, $listeners } = this
|
||||
const collapseClassName = {
|
||||
|
@ -21,6 +28,7 @@ export default {
|
|||
const rcCollapeProps = {
|
||||
props: {
|
||||
...getOptionProps(this),
|
||||
expandIcon: this.renderExpandIcon,
|
||||
},
|
||||
class: collapseClassName,
|
||||
on: $listeners,
|
||||
|
|
|
@ -57,7 +57,7 @@ export default {
|
|||
}
|
||||
let icon = null
|
||||
if (showArrow && typeof expandIcon === 'function') {
|
||||
icon = cloneElement(expandIcon, { ...this.$props })
|
||||
icon = cloneElement(expandIcon(this.$props))
|
||||
}
|
||||
return (
|
||||
<div class={itemCls} role='tablist'>
|
||||
|
|
Loading…
Reference in New Issue