Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]
As a component of the Vue to follow the state change Vuex? - bug-code.com Q&A

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

0 like 0 dislike
41 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 | 41 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
Welcome to Bug-code Q&A, where you can ask questions and receive answers from other members of the community.

24.8k questions

46.2k answers

0 comments

12.3k users

24,788 questions
46,220 answers
0 comments
12,337 users