-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCollapsePanel.jsx
39 lines (35 loc) · 903 Bytes
/
CollapsePanel.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import PropTypes from '../_util/vue-types'
import { getOptionProps } from '../_util/props-util'
import RcCollapse from './src'
import { panelProps } from './src/commonProps'
export default {
name: 'ACollapsePanel',
props: {
name: PropTypes.string,
...panelProps,
},
render () {
const { prefixCls, showArrow = true, $listeners } = this
const collapsePanelClassName = {
[`${prefixCls}-no-arrow`]: !showArrow,
}
const rcCollapePanelProps = {
props: {
...getOptionProps(this),
},
class: collapsePanelClassName,
on: $listeners,
}
const { default: defaultSlots, header } = this.$slots
return (
<RcCollapse.Panel {...rcCollapePanelProps} >
{defaultSlots}
{header ? (
<template slot='header'>
{header}
</template>
) : null}
</RcCollapse.Panel>
)
},
}