2👍
✅
You should use promises….
Make an async call to fetch the data and then (it’s literally ‘then’) do your populate function.
So it would look something like this…
mounted () {
$http.get('url_here').then( (response) => {
self.data = response.data
populateTable()
})
}
Hope that helps. If you use Vue Resource (as shown above) this includes $http.get which returns the promise for you. Check out the documentation.
Source:stackexchange.com