Created
May 27, 2018 12:56
-
-
Save firminochangani/a47cf67447788be4231048bd7c5fb393 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
created() { | |
const API_POSTS = 'https://jsonplaceholder.typicode.com/posts'; | |
fetch(API_POSTS, {method: 'GET'}) | |
.then(res => res.json()) | |
.then(json => { | |
this.posts = json; | |
/* Set loading to false after the content | |
is ready to be displayed */ | |
this.loading = false; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment