Optimize append and remove options
This commit is contained in:
parent
17db7df4fd
commit
9c32a05699
3 changed files with 30 additions and 29 deletions
14
src/components/select/utils.js
Normal file
14
src/components/select/utils.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
export function debounce(fn) {
|
||||
let waiting;
|
||||
return function() {
|
||||
if (waiting) return;
|
||||
waiting = true;
|
||||
const context = this,
|
||||
args = arguments;
|
||||
const later = function() {
|
||||
waiting = false;
|
||||
fn.apply(context, args);
|
||||
};
|
||||
this.$nextTick(later);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue