File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ module.exports = {
9
9
}
10
10
} ,
11
11
props : {
12
+ /**
13
+ * Decide whether to filter the results based on search query.
14
+ * Useful for async filtering, where we search through more complex data.
15
+ * @type {Boolean }
16
+ */
17
+ localSearch : {
18
+ type : Boolean ,
19
+ default : true
20
+ } ,
12
21
/**
13
22
* Array of available options: Objects, Strings or Integers.
14
23
* If array of objects, visible label will default to option.label.
@@ -176,9 +185,11 @@ module.exports = {
176
185
let options = this . hideSelected
177
186
? this . options . filter ( this . isNotSelected )
178
187
: this . options
179
- options = this . label
180
- ? options . filter ( ( option ) => option [ this . label ] . includes ( this . search ) )
181
- : options . filter ( ( option ) => option . includes ( this . search ) )
188
+ if ( this . localSearch ) {
189
+ options = this . label
190
+ ? options . filter ( ( option ) => option [ this . label ] . includes ( this . search ) )
191
+ : options . filter ( ( option ) => option . includes ( this . search ) )
192
+ }
182
193
if ( this . taggable && search . length && ! this . isExistingOption ( search ) ) {
183
194
options . unshift ( { isTag : true , label : search } )
184
195
}
You can’t perform that action at this time.
0 commit comments