Commit 21f6940672e1c692b0f612214233e0f882b940fc

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

fixed #3817 #3836

src/components/select/select-head.vue
... ... @@ -58,7 +58,7 @@
58 58 default: false
59 59 },
60 60 initialLabel: {
61   - type: String,
  61 + type: [String, Number, Array],
62 62 },
63 63 values: {
64 64 type: Array,
... ...
src/components/select/select.vue
... ... @@ -351,7 +351,7 @@
351 351 });
352 352 });
353 353 }
354   -
  354 + let hasDefaultSelected = slotOptions.some(option => this.query === option.key);
355 355 for (let option of slotOptions) {
356 356  
357 357 const cOptions = option.componentOptions;
... ... @@ -375,11 +375,13 @@
375 375 if (cOptions.children.length > 0) selectOptions.push({...option});
376 376 } else {
377 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 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  
... ...