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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user