Last active
March 28, 2020 17:06
-
-
Save mercs600/55c912e85428f80e5926482d210d5620 to your computer and use it in GitHub Desktop.
nuxt-ssr-exercise-3_error-handle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
asyncData: ({ $http, params, error }) => $http | |
.$get(`https://jsonplaceholder.typicode.com/posts/${params.id}`) | |
.then(post => ({ post })) | |
.catch(err => error(err)) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment