mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
@@ -436,6 +436,9 @@
|
|||||||
type: Function,
|
type: Function,
|
||||||
default(option) {
|
default(option) {
|
||||||
if (typeof option === 'object') {
|
if (typeof option === 'object') {
|
||||||
|
if (!option.hasOwnProperty(this.label)) {
|
||||||
|
return console.warn(`[vue-select warn]: Label key "option.${this.label}" does not exist in options object.\nhttp://sagalbot.github.io/vue-select/#ex-labels`)
|
||||||
|
}
|
||||||
if (this.label && option[this.label]) {
|
if (this.label && option[this.label]) {
|
||||||
return option[this.label]
|
return option[this.label]
|
||||||
}
|
}
|
||||||
@@ -847,12 +850,11 @@
|
|||||||
*/
|
*/
|
||||||
filteredOptions() {
|
filteredOptions() {
|
||||||
let options = this.mutableOptions.filter((option) => {
|
let options = this.mutableOptions.filter((option) => {
|
||||||
if (typeof option === 'object' && option.hasOwnProperty(this.label)) {
|
let label = this.getOptionLabel(option)
|
||||||
return option[this.label].toLowerCase().indexOf(this.search.toLowerCase()) > -1
|
if (typeof label === 'number') {
|
||||||
} else if (typeof option === 'object' && !option.hasOwnProperty(this.label)) {
|
label = label.toString()
|
||||||
return console.warn(`[vue-select warn]: Label key "option.${this.label}" does not exist in options object.\nhttp://sagalbot.github.io/vue-select/#ex-labels`)
|
|
||||||
}
|
}
|
||||||
return option.toLowerCase().indexOf(this.search.toLowerCase()) > -1
|
return label.toLowerCase().indexOf(this.search.toLowerCase()) > -1
|
||||||
})
|
})
|
||||||
if (this.taggable && this.search.length && !this.optionExists(this.search)) {
|
if (this.taggable && this.search.length && !this.optionExists(this.search)) {
|
||||||
options.unshift(this.search)
|
options.unshift(this.search)
|
||||||
|
|||||||
Reference in New Issue
Block a user