I know that actions handle asynchronous processing. I don’t have asynchronous operations. What I mean is that after clicking a button, the value in the state is directly changed in the methods, without actions or mutations. Does this comply with the specifications of vue?
About why you can’t directly call the mutation method or directly modify the state attribute, but you must submit the mutation through commit? Quote from official documentation:
It can be seen that when designing vuex, in order to track changes in state, it was agreed that commit must be used to submit changes in mutation-triggered data. You can try the official vue debugging plug-in, called Vue Devtools. You can directly see components, data, vuex, etc., and you can also track changes. If you try it, you will probably know why you do this.