Это работает просто отлично.
created() {
this['shared/getPosts']();
this['posts/getPosts']();
},
methods: {
...mapActions(['shared/getPosts', 'posts/getPosts']),
},
Но, мне было интересно, есть ли способ заставить код ниже работать так, как ожидалось, пожалуйста, см. Комментарий:
created() {
this.getPosts(); // triggers last method
},
methods: {
...mapActions('shared', ['getPosts']), // how to trigger this?
...mapActions('posts', ['getPosts']), // this gets triggered.
},