Skip to content

Commit 517bfbe

Browse files
author
Miranda
committed
Added functionality to be able to use an array within a query string.
Because it add's possibilities for custom parameters.
1 parent 74be390 commit 517bfbe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/js/components/vue-autocomplete.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,13 @@
334334
let params = `${this.param}=${encode(val)}`
335335
if(this.customParams) {
336336
Object.keys(this.customParams).forEach((key) => {
337-
params += `&${key}=${encode(this.customParams[key])}`
337+
if(Array.isArray(this.customParams[key])) {
338+
this.customParams[key].forEach(function (value) {
339+
params += `&${key}[]=${encode(value)}`
340+
});
341+
} else {
342+
params += `&${key}=${encode(this.customParams[key])}`
343+
}
338344
})
339345
}
340346
return params

0 commit comments

Comments
 (0)