This commit is contained in:
梁灏 2019-01-07 11:41:56 +08:00
parent 35c70b9576
commit 323494917f

View file

@ -22,7 +22,7 @@
@keydown="resetInputState" @keydown="resetInputState"
@keydown.delete="handleInputDelete" @keydown.delete="handleInputDelete"
@focus="onInputFocus" @focus="onInputFocus"
@blur="onInputFocus" @blur="onInputBlur"
ref="input"> ref="input">
<Icon type="ios-close-circle" :class="[prefixCls + '-arrow']" v-if="resetSelect" @click.native.stop="onClear"></Icon> <Icon type="ios-close-circle" :class="[prefixCls + '-arrow']" v-if="resetSelect" @click.native.stop="onClear"></Icon>
@ -146,8 +146,12 @@
} }
}, },
methods: { methods: {
onInputFocus(e){ onInputFocus(){
this.$emit(e.type === 'focus' ? 'on-input-focus' : 'on-input-blur'); this.$emit('on-input-focus');
},
onInputBlur () {
if (!this.values.length) this.query = ''; // #5155
this.$emit('on-input-blur');
}, },
removeTag (value) { removeTag (value) {
if (this.disabled) return false; if (this.disabled) return false;