Skip to content

Instantly share code, notes, and snippets.

@kabitacode
Last active April 16, 2019 13:57
Show Gist options
  • Save kabitacode/cdf79c4701d4fa6ac7c9e1f7a552e386 to your computer and use it in GitHub Desktop.
Save kabitacode/cdf79c4701d4fa6ac7c9e1f7a552e386 to your computer and use it in GitHub Desktop.
<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