This commit is contained in:
郑敏 2018-06-07 09:58:13 +08:00
parent 73b01ee06b
commit 21f6940672
2 changed files with 7 additions and 5 deletions

View file

@ -58,7 +58,7 @@
default: false
},
initialLabel: {
type: String,
type: [String, Number, Array],
},
values: {
type: Array,

View file

@ -351,7 +351,7 @@
});
});
}
let hasDefaultSelected = slotOptions.some(option => this.query === option.key);
for (let option of slotOptions) {
const cOptions = option.componentOptions;
@ -375,11 +375,13 @@
if (cOptions.children.length > 0) selectOptions.push({...option});
} else {
// ignore option if not passing filter
const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;
if (!optionPassesFilter) continue;
if (!hasDefaultSelected) {
const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;
if (!optionPassesFilter) continue;
}
optionCounter = optionCounter + 1;
selectOptions.push(this.processOption(option, selectedValues, optionCounter === currentIndex));
selectOptions.push(this.processOption(option, selectedValues, false));
}
}