mirror of https://github.com/ElemeFE/element
Select: debounce query (#12181)
parent
c5347b8064
commit
7f2510f0f1
|
@ -62,8 +62,7 @@
|
||||||
@compositionupdate="handleComposition"
|
@compositionupdate="handleComposition"
|
||||||
@compositionend="handleComposition"
|
@compositionend="handleComposition"
|
||||||
v-model="query"
|
v-model="query"
|
||||||
@input="e => handleQueryChange(e.target.value)"
|
@input="debouncedQueryChange"
|
||||||
:debounce="remote ? 300 : 0"
|
|
||||||
v-if="filterable"
|
v-if="filterable"
|
||||||
:style="{ width: inputLength + 'px', 'max-width': inputWidth - 42 + 'px' }"
|
:style="{ width: inputLength + 'px', 'max-width': inputWidth - 42 + 'px' }"
|
||||||
ref="input">
|
ref="input">
|
||||||
|
@ -849,6 +848,10 @@
|
||||||
this.onInputChange();
|
this.onInputChange();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.debouncedQueryChange = debounce(this.debounce, (e) => {
|
||||||
|
this.handleQueryChange(e.target.value);
|
||||||
|
});
|
||||||
|
|
||||||
this.$on('handleOptionClick', this.handleOptionSelect);
|
this.$on('handleOptionClick', this.handleOptionSelect);
|
||||||
this.$on('setSelected', this.setSelected);
|
this.$on('setSelected', this.setSelected);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue