File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,38 @@ Method | Description
261261** removeParameters([ key1, key2] )** | Remove params by keys
262262** removeParameters()** | Remove all params
263263
264+ #### setParameters()
265+
266+ Set parameters with key/value.
267+
268+ ** Note** : If you to pass query string as object that can be response like object format at api side.
269+
270+ #### Example
271+
272+ ``` js
273+ const proxy = new ExampleProxy ()
274+ const parameters = {
275+ search: {
276+ first_name: ' Sek' ,
277+ last_name: ' Chantouch'
278+ },
279+ page: {
280+ limit: 20 ,
281+ offset: 1
282+ },
283+ order: {
284+ first_name: ' ASC' ,
285+ last_name: ' DESC'
286+ },
287+ category_id: 6
288+ }
289+ const { data } = proxy .setParameters (parameters).all ()
290+ this .data = data
291+ ```
292+ ** Note** : Query object above will transform into query string like:
293+
294+ `` https://my-web-url.com?search[first_name]=Sek&search[last_name]=Chantouch&page[limit]=10&page[offset]=1&order[first_name]=asc&order[last_name]=desc&category_id=6 ``
295+
264296if setParameter that value is empty or null it will remove that param for query string
265297
266298Be sure to use only once in ` mounted() ` or ` asyncData() ` and ` asyncData() ` is only available in ` NuxtJs `
You can’t perform that action at this time.
0 commit comments