feat: update collapse

pull/309/head
tangjinzhou 2018-12-15 21:51:17 +08:00
parent e1cd139e8b
commit c36f435769
2 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import animation from '../_util/openAnimation'
import { getOptionProps, initDefaultProps } from '../_util/props-util'
import VcCollapse, { collapseProps } from '../vc-collapse'
import Icon from '../icon'
export default {
name: 'ACollapse',
model: {
@ -13,6 +13,13 @@ export default {
bordered: true,
openAnimation: animation,
}),
methods: {
renderExpandIcon () {
return (
<Icon type='right' class='arrow' />
)
},
},
render () {
const { prefixCls, bordered, $listeners } = this
const collapseClassName = {
@ -21,6 +28,7 @@ export default {
const rcCollapeProps = {
props: {
...getOptionProps(this),
expandIcon: this.renderExpandIcon,
},
class: collapseClassName,
on: $listeners,

View File

@ -57,7 +57,7 @@ export default {
}
let icon = null
if (showArrow && typeof expandIcon === 'function') {
icon = cloneElement(expandIcon, { ...this.$props })
icon = cloneElement(expandIcon(this.$props))
}
return (
<div class={itemCls} role='tablist'>