Commit 62b0e2ac authored by 杨奕's avatar 杨奕 Committed by GitHub

Select: remove unnecessary remote query when focused (#9998)

parent 067a9be7
...@@ -406,7 +406,10 @@ ...@@ -406,7 +406,10 @@
methods: { methods: {
handleQueryChange(val) { handleQueryChange(val) {
if (this.previousQuery === val) return; if (this.previousQuery === val) return;
if (this.previousQuery === null && typeof this.filterMethod === 'function') { if (
this.previousQuery === null &&
(typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')
) {
this.previousQuery = val; this.previousQuery = val;
return; return;
} }
......
...@@ -626,6 +626,7 @@ describe('Select', () => { ...@@ -626,6 +626,7 @@ describe('Select', () => {
remoteMethod remoteMethod
}); });
const select = vm.$children[0]; const select = vm.$children[0];
select.handleQueryChange('');
vm.$nextTick(() => { vm.$nextTick(() => {
select.handleQueryChange(''); select.handleQueryChange('');
setTimeout(() => { setTimeout(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment