mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 20:18:22 +08:00
37 lines
907 B
JavaScript
37 lines
907 B
JavaScript
|
|
import PropTypes from '../_util/vue-types'
|
|
import animation from '../_util/openAnimation'
|
|
import { getOptionProps } from '../_util/props-util'
|
|
import RcCollapse from './src'
|
|
import { collapseProps } from './src/commonProps'
|
|
|
|
export default {
|
|
name: 'ACollapse',
|
|
model: {
|
|
prop: 'activeKey',
|
|
event: 'change',
|
|
},
|
|
props: {
|
|
...collapseProps,
|
|
bordered: PropTypes.bool.def(true),
|
|
openAnimation: PropTypes.any.def(animation),
|
|
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>
|
|
},
|
|
}
|
|
|