Browse Source

add select animate

pull/9/head
tangjinzhou 7 years ago
parent
commit
6ee21bcfd3
  1. 1
      components/vc-menu/MenuItem.vue
  2. 12
      components/vc-select/Select.vue
  3. 2
      components/vc-select/SelectTrigger.vue

1
components/vc-menu/MenuItem.vue

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

12
components/vc-select/Select.vue

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

2
components/vc-select/SelectTrigger.vue

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

Loading…
Cancel
Save