2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-10 07:52:23 +03:00

Merge pull request #386 from alfatraining/add-prop-to-disable-option-filtering

Add prop to disable option filtering
This commit is contained in:
Jeff
2017-12-09 09:43:49 -08:00
committed by GitHub
4 changed files with 94 additions and 3 deletions
+14
View File
@@ -520,6 +520,17 @@
default: false
},
/**
* When true, existing options will be filtered
* by the search text. Should not be used in conjunction
* with taggable.
* @type {Boolean}
*/
filterOptions: {
type: Boolean,
default: true
},
/**
* User defined function for adding Options
* @type {Function}
@@ -904,6 +915,9 @@
* @return {array}
*/
filteredOptions() {
if (!this.filterOptions && !this.taggable) {
return this.mutableOptions.slice()
}
let options = this.mutableOptions.filter((option) => {
if (typeof option === 'object' && option.hasOwnProperty(this.label)) {
return option[this.label].toLowerCase().indexOf(this.search.toLowerCase()) > -1