2018-02-01 10:18:05 +00:00
|
|
|
import animation from '../_util/openAnimation'
|
2018-09-05 13:28:54 +00:00
|
|
|
import { getOptionProps, initDefaultProps } from '../_util/props-util'
|
|
|
|
import VcCollapse, { collapseProps } from '../vc-collapse'
|
2018-12-15 13:51:17 +00:00
|
|
|
import Icon from '../icon'
|
2018-02-01 10:18:05 +00:00
|
|
|
export default {
|
2018-04-08 13:17:20 +00:00
|
|
|
name: 'ACollapse',
|
2018-02-02 08:34:27 +00:00
|
|
|
model: {
|
|
|
|
prop: 'activeKey',
|
|
|
|
event: 'change',
|
|
|
|
},
|
2018-09-05 13:28:54 +00:00
|
|
|
props: initDefaultProps(collapseProps, {
|
|
|
|
prefixCls: 'ant-collapse',
|
|
|
|
bordered: true,
|
|
|
|
openAnimation: animation,
|
|
|
|
}),
|
2018-12-15 13:51:17 +00:00
|
|
|
methods: {
|
|
|
|
renderExpandIcon () {
|
|
|
|
return (
|
|
|
|
<Icon type='right' class='arrow' />
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
2018-02-01 10:18:05 +00:00
|
|
|
render () {
|
|
|
|
const { prefixCls, bordered, $listeners } = this
|
|
|
|
const collapseClassName = {
|
|
|
|
[`${prefixCls}-borderless`]: !bordered,
|
|
|
|
}
|
|
|
|
const rcCollapeProps = {
|
|
|
|
props: {
|
|
|
|
...getOptionProps(this),
|
2018-12-15 13:51:17 +00:00
|
|
|
expandIcon: this.renderExpandIcon,
|
2018-02-01 10:18:05 +00:00
|
|
|
},
|
|
|
|
class: collapseClassName,
|
|
|
|
on: $listeners,
|
|
|
|
}
|
2018-09-05 13:28:54 +00:00
|
|
|
return <VcCollapse {...rcCollapeProps}>{this.$slots.default}</VcCollapse>
|
2018-02-01 10:18:05 +00:00
|
|
|
},
|
|
|
|
}
|
2018-03-19 02:16:27 +00:00
|
|
|
|