2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-26 04:34:04 +03:00

Updated with Magnum5234 tip

This commit is contained in:
Cristian Totola
2018-11-12 17:27:14 +01:00
parent b03868c449
commit a5f6add768
+4 -10
View File
@@ -904,18 +904,12 @@
* @return {Boolean} True when selected | False otherwise
*/
isOptionSelected(option) {
let selected = false
let i = 0
while (!selected && i < this.valueAsArray.length) {
let value = this.valueAsArray[i]
return this.valueAsArray.some(value => {
if (typeof value === 'object') {
selected = this.optionObjectComparator(value, option)
} else if (value === option || value === option[i]) {
selected = true
return this.optionObjectComparator(value, option)
}
i++
}
return selected
return value === option || value === option[this.index]
})
},
/**