Answer the question
In order to leave comments, you need to log in
How to load component after http request using vue 2 js?
How to implement component loading after completion of http request .
according to the documentation, I tried beforeRouteEnter, the data is loaded
in parallel in angular 1st, this was implemented when creating the route (resolve)
.state('home.citypointDetail', {
url: "citypoint/:citypointID",
templateUrl: static + '/citypoint/details.html',
controller: 'CitypointDetailController',
resolve: {
citypoint: function (CitypointService, $stateParams) {
var id = $stateParams.citypointID;
return $http.get('/url/', params: {});
}
}
})
Answer the question
In order to leave comments, you need to log in
Just add a variable to the data, something like is_loaded: false
And display the required component through v-if="is_loaded"
Accordingly, if the request is successful, change is_loaded: true
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question