2019-01-12 03:33:27 +00:00
|
|
|
import animation from '../_util/openAnimation';
|
|
|
|
import { getOptionProps, initDefaultProps } from '../_util/props-util';
|
|
|
|
import VcCollapse, { collapseProps } from '../vc-collapse';
|
|
|
|
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',
|
|
|
|
},
|
2019-02-21 06:31:35 +00:00
|
|
|
props: initDefaultProps(collapseProps(), {
|
2018-09-05 13:28:54 +00:00
|
|
|
prefixCls: 'ant-collapse',
|
|
|
|
bordered: true,
|
|
|
|
openAnimation: animation,
|
|
|
|
}),
|
2018-12-15 13:51:17 +00:00
|
|
|
methods: {
|
2019-01-12 03:33:27 +00:00
|
|
|
renderExpandIcon() {
|
|
|
|
return <Icon type="right" class="arrow" />;
|
2018-12-15 13:51:17 +00:00
|
|
|
},
|
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
render() {
|
|
|
|
const { prefixCls, bordered, $listeners } = this;
|
2018-02-01 10:18:05 +00:00
|
|
|
const collapseClassName = {
|
|
|
|
[`${prefixCls}-borderless`]: !bordered,
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|
2018-02-01 10:18:05 +00:00
|
|
|
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,
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|
|
|
|
return <VcCollapse {...rcCollapeProps}>{this.$slots.default}</VcCollapse>;
|
2018-02-01 10:18:05 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|