Commit 21f6940672e1c692b0f612214233e0f882b940fc

Authored by ้ƒ‘ๆ•
1 parent 73b01ee0

fixed #3817 #3836

src/components/select/select-head.vue
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 default: false 58 default: false
59 }, 59 },
60 initialLabel: { 60 initialLabel: {
61 - type: String, 61 + type: [String, Number, Array],
62 }, 62 },
63 values: { 63 values: {
64 type: Array, 64 type: Array,
src/components/select/select.vue
@@ -351,7 +351,7 @@ @@ -351,7 +351,7 @@
351 }); 351 });
352 }); 352 });
353 } 353 }
354 - 354 + let hasDefaultSelected = slotOptions.some(option => this.query === option.key);
355 for (let option of slotOptions) { 355 for (let option of slotOptions) {
356 356
357 const cOptions = option.componentOptions; 357 const cOptions = option.componentOptions;
@@ -375,11 +375,13 @@ @@ -375,11 +375,13 @@
375 if (cOptions.children.length > 0) selectOptions.push({...option}); 375 if (cOptions.children.length > 0) selectOptions.push({...option});
376 } else { 376 } else {
377 // ignore option if not passing filter 377 // ignore option if not passing filter
378 - const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;  
379 - if (!optionPassesFilter) continue; 378 + if (!hasDefaultSelected) {
  379 + const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;
  380 + if (!optionPassesFilter) continue;
  381 + }
380 382
381 optionCounter = optionCounter + 1; 383 optionCounter = optionCounter + 1;
382 - selectOptions.push(this.processOption(option, selectedValues, optionCounter === currentIndex)); 384 + selectOptions.push(this.processOption(option, selectedValues, false));
383 } 385 }
384 } 386 }
385 387