add select animate

pull/9/head
tangjinzhou 2018-02-12 14:45:26 +08:00
parent a88f5579b1
commit 6ee21bcfd3
3 changed files with 12 additions and 3 deletions

View File

@ -15,6 +15,7 @@ const props = {
level: PropTypes.number.def(1), level: PropTypes.number.def(1),
mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']).def('vertical'), mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']).def('vertical'),
parentMenu: PropTypes.object, parentMenu: PropTypes.object,
multiple: PropTypes.bool,
// clearSubMenuTimers: PropTypes.func.def(noop), // clearSubMenuTimers: PropTypes.func.def(noop),
} }
const MenuItem = { const MenuItem = {

View File

@ -1361,13 +1361,14 @@ export default {
// component='ul' // component='ul'
// transitionName={choiceTransitionName} // transitionName={choiceTransitionName}
{...transitionProps} {...transitionProps}
onClick={this.muitipleContainerClick}
> >
{selectedValueNodes} {selectedValueNodes}
</transition-group> </transition-group>
) )
} else { } else {
innerNode = ( innerNode = (
<ul> <ul onClick={this.muitipleContainerClick}>
{selectedValueNodes} {selectedValueNodes}
</ul> </ul>
) )
@ -1380,7 +1381,11 @@ export default {
</div> </div>
) )
}, },
muitipleContainerClick (e) {
if (this.openStatus) {
e.stopPropagation()
}
},
renderClear () { renderClear () {
const { prefixCls, allowClear, sValue, inputValue } = this const { prefixCls, allowClear, sValue, inputValue } = this
const clear = ( const clear = (
@ -1447,6 +1452,7 @@ export default {
render () { render () {
const props = this.$props const props = this.$props
const multiple = isMultipleOrTags(props) const multiple = isMultipleOrTags(props)
const preOptions = this._options || []
const { options, open: openStatus } = this.getOptionsAndOpenStatus() const { options, open: openStatus } = this.getOptionsAndOpenStatus()
const { disabled, prefixCls, inputValue, sValue, $listeners } = this const { disabled, prefixCls, inputValue, sValue, $listeners } = this
const { mouseenter = noop, mouseleave = noop, popupScroll = noop } = $listeners const { mouseenter = noop, mouseleave = noop, popupScroll = noop } = $listeners
@ -1494,7 +1500,7 @@ export default {
dropdownStyle={props.dropdownStyle} dropdownStyle={props.dropdownStyle}
combobox={props.combobox} combobox={props.combobox}
showSearch={props.showSearch} showSearch={props.showSearch}
options={options} options={options.length || openStatus ? options : preOptions}
multiple={multiple} multiple={multiple}
disabled={disabled} disabled={disabled}
visible={openStatus} visible={openStatus}

View File

@ -50,6 +50,8 @@ export default {
// children: PropTypes.any, // children: PropTypes.any,
showAction: PropTypes.arrayOf(PropTypes.string), showAction: PropTypes.arrayOf(PropTypes.string),
combobox: PropTypes.bool, combobox: PropTypes.bool,
animation: PropTypes.string,
transitionName: PropTypes.string,
}, },
data () { data () {
return { return {