Last active
April 16, 2019 13:57
-
-
Save kabitacode/cdf79c4701d4fa6ac7c9e1f7a552e386 to your computer and use it in GitHub Desktop.
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
<script> | |
/* eslint-disable */ | |
import axios from 'axios' | |
export default { | |
data(){ | |
return{ | |
users: [] | |
} | |
}, | |
mounted() { | |
this.load() | |
}, | |
methods: { | |
load(){ | |
axios.get('http://localhost:3000/users').then(res => { | |
this.users = res.data //respon dari rest api dimasukan ke users | |
}).catch ((err) => { | |
console.log(err); | |
}) | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment