Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gufranmirza
Created July 8, 2019 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gufranmirza/0d74d95c3389d4cf34f47804adc7afc7 to your computer and use it in GitHub Desktop.
Save gufranmirza/0d74d95c3389d4cf34f47804adc7afc7 to your computer and use it in GitHub Desktop.
// pages/products/_id.vue
export default {
asyncData(context) {
return axios.get(`https://my-api-server/api/products/${params.id}, (response) => {
return { product: response.data };
});
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment