2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00

Merge branch 'MrStobbart-master'

This commit is contained in:
Jeff
2019-02-09 15:29:00 -08:00
2 changed files with 23 additions and 5 deletions
+4 -1
View File
@@ -75,9 +75,12 @@
<v-select placeholder="filtering with fuse.js" label="title" :options="fuseSearchOptions" :filter="fuseSearch">
<template slot="option" scope="option">
<strong>{{ option.title }}</strong><br>
<em>{{ `${option.author.firstName} ${option.author.lastName}` }}</em>
<em>{{ option.author.firstName + ' ' + option.author.lastName }}</em>
</template>
</v-select>
<v-select placeholder="Vue select with no options and a custom no-option span" >
<span slot="no-options">Custom no options message</span>
</v-select>
</div>
</body>
+19 -4
View File
@@ -917,8 +917,8 @@
isOptionSelected(option) {
let selected = false
this.valueAsArray.forEach(value => {
if (typeof value === 'object') {
selected = this.optionObjectComparator(value, option)
if (typeof value === 'object' && this.optionObjectComparator(value, option)) {
selected = true
} else if (value === option || value === option[this.index]) {
selected = true
}
@@ -986,9 +986,24 @@
if (this.clearSearchOnBlur) {
this.search = ''
}
this.open = false
this.$emit('search:blur')
this.closeSearchOptions()
return
}
// Fixed bug where no-options message could not be closed
if(this.search.length === 0 && this.options.length === 0){
this.closeSearchOptions()
return
}
},
/**
* 'Private' function to close the search options
* @emits {search:blur}
* @returns {void}
*/
closeSearchOptions(){
this.open = false
this.$emit('search:blur')
},
/**