[Vuejs]-API response with this.$route.params.slug

3👍

You have a string where you shouldn’t:

axios.get('this.$route.params.slug')

should be

axios.get(this.$route.params.slug)

You probably need to construct the URL using the slug parameter, so I expect it would be something like this:

axios.get('/resource/' + this.$route.params.slug)

but this depends on your API server.

Leave a comment