ant-design-vue/components/collapse/CollapsePanel.jsx

40 lines
903 B
React
Raw Normal View History

2018-03-19 02:16:27 +00:00
2018-02-01 10:18:05 +00:00
import PropTypes from '../_util/vue-types'
import { getOptionProps } from '../_util/props-util'
import RcCollapse from './src'
import { panelProps } from './src/commonProps'
export default {
2018-04-08 13:17:20 +00:00
name: 'ACollapsePanel',
2018-02-01 10:18:05 +00:00
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,
}
2018-02-02 09:19:42 +00:00
const { default: defaultSlots, header } = this.$slots
return (
<RcCollapse.Panel {...rcCollapePanelProps} >
{defaultSlots}
{header ? (
<template slot='header'>
{header}
</template>
) : null}
</RcCollapse.Panel>
)
2018-02-01 10:18:05 +00:00
},
}
2018-03-19 02:16:27 +00:00