0👍
mapActions
maps your actions to store.dispatch
, which returns a promise. You should be able to simply wait for the promise to resolve and then do your callback:
export default {
...
props: ['leagueId'],
created() {
this.getTopLeague([{league_id: this.leagueId}])
.then(function(){
$('.slick').not('.slick-initialized').slick({slidesToShow: 3, infinite: false});
})
},
...
- [Vuejs]-How to fix google map center location in vue js
- [Vuejs]-Why does Javascript not see new elements created by VueJS?
0👍
I would suggest using an Ajax framework like Axios, or Vue-Resource and then wait for the server to respond before triggering your code.
axios.get(url)
.then( res => {
//your code.
})
- [Vuejs]-Assigning stream to a variable from getUserMedia()
- [Vuejs]-Vue.js webpack and static images (without vuecli and nodejs dev server)
Source:stackexchange.com