fix AutoComplete on-select event error

This commit is contained in:
梁灏 2019-12-16 11:30:00 +08:00
parent ed741b1666
commit dd35ff0f8c

View file

@ -13,7 +13,7 @@
remote remote
auto-complete auto-complete
:remote-method="remoteMethod" :remote-method="remoteMethod"
@on-change="handleChange" @on-select="handleSelect"
@on-clickoutside="handleClickOutside" @on-clickoutside="handleClickOutside"
:transfer="transfer"> :transfer="transfer">
<slot name="input"> <slot name="input">
@ -152,7 +152,8 @@
remoteMethod (query) { remoteMethod (query) {
this.$emit('on-search', query); this.$emit('on-search', query);
}, },
handleChange (val) { handleSelect (option) {
const val = option.value;
if (val === undefined || val === null) return; if (val === undefined || val === null) return;
this.currentValue = val; this.currentValue = val;
this.$refs.input.blur(); this.$refs.input.blur();