Y
Y
Yasuro2019-10-13 22:09:00
Vue.js
Yasuro, 2019-10-13 22:09:00

How to dynamically change address and request params of vue-resource?

I want to use this: https://github.com/pagekit/vue-resource
There is a module like this:

import Vue from 'vue'
const resource = Vue.http;

class UiRequest {
    getParameters : {
    id:2,
    provider: 'custom'
    }
    async executeGetRequest(addreess) {
        const result = await resource.get("inputPoint",{params:this.parametersRequest});
        const data = await result.json();
        await console.log(data);
      }
}

I want to initialize a UiRequest object and then call its executeGetRequest('input/point') method and make a request to this address: localhost:8080/input/point?id=2&provider=custom.
I don't understand how to dynamically change address in resource.
Yes, there are Custom Actions, but in this case, I can't change the url anywhere in the code.
In the above code, the result will be:
" localhost:8080?0=t&1=e&2=s&3=t "

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question