mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
Merge branch 'master' of https://github.com/MrStobbart/vue-select into MrStobbart-master
# Conflicts: # dist/vue-select.js # dist/vue-select.js.map
This commit is contained in:
+4
-1
@@ -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>
|
||||
|
||||
|
||||
@@ -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')
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user