[Vuejs]-How to pass query parameters in axios

1👍

If you just need to request http://localhost:5000/trackers/{{id}},

you can build the request url like this:

...
  axios.get('http://localhost:5000/trackers/' + id)
...

0👍

Can you try once with the following code?

mounted() {
    axios.get(`http://localhost:5000/trackers/${id}`)
    .then((resp ) => console.log(resp.data))
    .catch((err) => console.log(err.response))
    let id = localStorage['id'] 
    return{
        id
    }
}

Leave a comment