Home  >  Q&A  >  body text

javascript - How does a method in vuex state management mutations call another fangfa? How does a method call itself to implement recursive calls?

Vue makes a component and wants to use vuex to manage it. But I encountered a problem. One method in mutations wants to use another method in mutations. How to achieve this?
There is also a method in mutations that wants to call itself to implement recursive calls. How to achieve this? ? ?

迷茫迷茫2712 days ago1187

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-19 10:45:03

    Official instructions indicate that it is more consistent to use actions~
    If you want to execute another mutation in one mutation, you can also store.commit('the name of another mutation').

    reply
    0
  • Cancelreply