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

36 lines
886 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 animation from '../_util/openAnimation'
import { getOptionProps } from '../_util/props-util'
import RcCollapse from './src'
2018-02-01 10:32:17 +00:00
import { collapseProps } from './src/commonProps'
2018-02-01 10:18:05 +00:00
export default {
2018-02-02 08:34:27 +00:00
model: {
prop: 'activeKey',
event: 'change',
},
2018-02-01 10:18:05 +00:00
props: {
2018-02-01 10:32:17 +00:00
...collapseProps,
2018-02-01 10:18:05 +00:00
bordered: PropTypes.bool.def(true),
2018-02-05 07:07:21 +00:00
openAnimation: PropTypes.any.def(animation),
2018-02-01 10:18:05 +00:00
change: PropTypes.func.def(() => {}),
accordion: PropTypes.bool,
},
render () {
const { prefixCls, bordered, $listeners } = this
const collapseClassName = {
[`${prefixCls}-borderless`]: !bordered,
}
const rcCollapeProps = {
props: {
...getOptionProps(this),
},
class: collapseClassName,
on: $listeners,
}
return <RcCollapse {...rcCollapeProps}>{this.$slots.default}</RcCollapse>
},
}
2018-03-19 02:16:27 +00:00