Merge pull request #1828 from SergioCrisostomo/fix-context-for-debounce

fix debounce context
This commit is contained in:
Aresn 2017-09-08 14:27:44 +08:00 committed by GitHub
commit 364aac0217

View file

@ -624,7 +624,8 @@
this.broadcast('iOption', 'on-query-change', val);
}
},
debouncedAppendRemove: debounce(function(){
debouncedAppendRemove(){
return debounce(function(){
if (!this.remote) {
this.modelToQuery();
this.$nextTick(() => this.broadcastQuery(''));
@ -635,7 +636,8 @@
}
this.slotChange();
this.updateOptions(true, true);
}),
});
},
// remote
updateLabel () {
if (this.remote) {
@ -669,8 +671,8 @@
this.updateOptions(true);
document.addEventListener('keydown', this.handleKeydown);
this.$on('append', this.debouncedAppendRemove);
this.$on('remove', this.debouncedAppendRemove);
this.$on('append', this.debouncedAppendRemove());
this.$on('remove', this.debouncedAppendRemove());
this.$on('on-select-selected', (value) => {
if (this.model === value) {