2019-01-12 03:33:27 +00:00
|
|
|
import { getOptionProps, getComponentFromProp } from '../_util/props-util';
|
|
|
|
import VcCollapse, { panelProps } from '../vc-collapse';
|
2018-02-01 10:18:05 +00:00
|
|
|
|
|
|
|
export default {
|
2018-04-08 13:17:20 +00:00
|
|
|
name: 'ACollapsePanel',
|
2018-02-01 10:18:05 +00:00
|
|
|
props: {
|
|
|
|
...panelProps,
|
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
render() {
|
|
|
|
const { prefixCls, showArrow = true, $listeners } = this;
|
2018-02-01 10:18:05 +00:00
|
|
|
const collapsePanelClassName = {
|
|
|
|
[`${prefixCls}-no-arrow`]: !showArrow,
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|
2018-02-01 10:18:05 +00:00
|
|
|
const rcCollapePanelProps = {
|
|
|
|
props: {
|
|
|
|
...getOptionProps(this),
|
|
|
|
},
|
|
|
|
class: collapsePanelClassName,
|
|
|
|
on: $listeners,
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|
|
|
|
const header = getComponentFromProp(this, 'header');
|
2018-02-02 09:19:42 +00:00
|
|
|
return (
|
2019-01-12 03:33:27 +00:00
|
|
|
<VcCollapse.Panel {...rcCollapePanelProps}>
|
2018-09-05 13:28:54 +00:00
|
|
|
{this.$slots.default}
|
2019-01-12 03:33:27 +00:00
|
|
|
{header ? <template slot="header">{header}</template> : null}
|
2018-09-05 13:28:54 +00:00
|
|
|
</VcCollapse.Panel>
|
2019-01-12 03:33:27 +00:00
|
|
|
);
|
2018-02-01 10:18:05 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|