A
A
Anton2017-07-25 12:54:21
JavaScript
Anton, 2017-07-25 12:54:21

How to track the state in store in vue if it has changed?

Good day everyone!
Available store

const state = {
  ticket: null
}

If there has been a change, you need to track it and update the value
this.$store.state.ticket

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2017-07-25
@Ooos

computed: {
        somevar(){
            return this.$store.getters.somevar;
        },

well, if you wish, hang a watcher
watch: {
        somevar: function() {
            
        },

Strange question, you use vuex, but you never looked at the documentation or what?

N
Negwereth, 2017-07-25
@Negwereth

Vuex

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question