diff --git a/src/components/Select.vue b/src/components/Select.vue index 1d87f54..8665e78 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -585,7 +585,7 @@ * @param {String} search * @return {Boolean} */ - filterMatch: { + filterBy: { type: Function, default(option, label, search) { return (label || '').toLowerCase().indexOf(search.toLowerCase()) > -1 @@ -596,7 +596,7 @@ * Callback to filter results when search text * is provided. Default implementation loops * each option, and returns the result of - * this.filterMatch. + * this.filterBy. * @type {Function} * @param {Array} list of options * @param {String} search text @@ -611,7 +611,7 @@ if (typeof label === 'number') { label = label.toString() } - return this.filterMatch(option, label, search) + return this.filterBy(option, label, search) }); } }, diff --git a/test/unit/specs/Select.spec.js b/test/unit/specs/Select.spec.js index a4d2433..c614c1c 100644 --- a/test/unit/specs/Select.spec.js +++ b/test/unit/specs/Select.spec.js @@ -324,7 +324,7 @@ describe('Select.vue', () => { it('can determine if a given option should match the current search text', () => { const vm = new Vue({ - template: `
`, + template: `
`, data: {value: 'foo'}, methods:{ customFn: (option, label, search) => label.match(new RegExp('^' + search, 'i'))