mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-19 09:50:33 +03:00
Updated with Magnum5234 tip
This commit is contained in:
@@ -904,18 +904,12 @@
|
|||||||
* @return {Boolean} True when selected | False otherwise
|
* @return {Boolean} True when selected | False otherwise
|
||||||
*/
|
*/
|
||||||
isOptionSelected(option) {
|
isOptionSelected(option) {
|
||||||
let selected = false
|
return this.valueAsArray.some(value => {
|
||||||
let i = 0
|
|
||||||
while (!selected && i < this.valueAsArray.length) {
|
|
||||||
let value = this.valueAsArray[i]
|
|
||||||
if (typeof value === 'object') {
|
if (typeof value === 'object') {
|
||||||
selected = this.optionObjectComparator(value, option)
|
return this.optionObjectComparator(value, option)
|
||||||
} else if (value === option || value === option[i]) {
|
|
||||||
selected = true
|
|
||||||
}
|
}
|
||||||
i++
|
return value === option || value === option[this.index]
|
||||||
}
|
})
|
||||||
return selected
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user