As a component of the Vue to follow the state change Vuex?

0 like 0 dislike
34 views
Hi! There are vuex podolany on the modules. In the module there is a messenger
const state = { messages: [] }


In component to track changes in messages array?
asked by | 34 views

2 Answers

0 like 0 dislike
computed: { todos: () { return this.$store.getters.getTodos } }


in store to create getters:

getters: { getTodos: state => state.todos }
answered by
0 like 0 dislike
https://vuex.vuejs.org/ru/guide/modules.html

computed: { ...mapState('some/nested/module', { a: state => state.a, b: state => state.b }) },
answered by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Sep 30, 2018 by microcoder
0 like 0 dislike
2 answers
asked Nov 10, 2018 by alekseydemyanenko
24,509 questions
45,932 answers
0 comments
345 users