fix: collapse controller mode
							parent
							
								
									777d1d5dda
								
							
						
					
					
						commit
						ed3c4edf72
					
				|  | @ -1 +1 @@ | |||
| Subproject commit 46fbd8fd067c497a740594a1b8cc8e503fc94a8a | ||||
| Subproject commit 4326327888f185e994eb7071d0b0b5edb1be2768 | ||||
|  | @ -35,6 +35,10 @@ export default { | |||
|           }) | ||||
|         : icon; | ||||
|     }, | ||||
|     handleChange(activeKey) { | ||||
|       this.$emit('update:activeKey', activeKey); | ||||
|       this.$emit('change', activeKey); | ||||
|     }, | ||||
|   }, | ||||
|   render() { | ||||
|     const { prefixCls: customizePrefixCls, bordered, expandIconPosition } = this; | ||||
|  | @ -52,6 +56,8 @@ export default { | |||
|       expandIcon: panelProps => this.renderExpandIcon(panelProps, prefixCls), | ||||
|       class: collapseClassName, | ||||
|       ...restAttrs, | ||||
|       onChange: this.handleChange, | ||||
|       'onUpdate:change': undefined, | ||||
|     }; | ||||
| 
 | ||||
|     return <VcCollapse {...rcCollapeProps}>{getSlot(this)}</VcCollapse>; | ||||
|  |  | |||
|  | @ -117,9 +117,10 @@ export default { | |||
|       return newChildren; | ||||
|     }, | ||||
|     setActiveKey(activeKey) { | ||||
|       this.setState({ stateActiveKey: activeKey }); | ||||
|       if (!hasProp(this, 'activeKey')) { | ||||
|         this.setState({ stateActiveKey: activeKey }); | ||||
|       } | ||||
|       this.__emit('change', this.accordion ? activeKey[0] : activeKey); | ||||
|       this.__emit('update:activeKey', this.accordion ? activeKey[0] : activeKey); | ||||
|     }, | ||||
|   }, | ||||
|   render() { | ||||
|  |  | |||
|  | @ -18,6 +18,8 @@ const collapseProps = () => ({ | |||
|   expandIcon: PropTypes.func, | ||||
|   openAnimation: PropTypes.object, | ||||
|   expandIconPosition: PropTypes.oneOf(['left', 'right']), | ||||
|   'onUpdate:change': PropTypes.func, | ||||
|   onChange: PropTypes.func, | ||||
| }); | ||||
| 
 | ||||
| const panelProps = () => ({ | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import demo from '../antdv-demo/docs/checkbox/demo/basic'; | ||||
| import demo from '../antdv-demo/docs/collapse/demo/index'; | ||||
| 
 | ||||
| export default { | ||||
|   components: { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 tanjinzhou
						tanjinzhou