Skip to content

Instantly share code, notes, and snippets.

@Strift
Created August 28, 2018 16:02
Show Gist options
  • Save Strift/430abe755a2e77222599c29a39cf3bc4 to your computer and use it in GitHub Desktop.
Save Strift/430abe755a2e77222599c29a39cf3bc4 to your computer and use it in GitHub Desktop.
var app = new Vue({
el: '#app',
data: {
requests: [],
listOfNames: []
},
created: function (argument) {
this.fetchRequests()
},
methods: {
fetchRequests () {
fetch('url').then(function(data) {
this.requests = data
}).then(function() {
fetch('other url').then(function(data) {
this.listOfNames = data
})
})
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment