You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if this a very basic question. From the examples in the docs and the source code, I guess I only can fire mutations when a property is set. What about actions? What if I always wanto to call some API before making a mutation? In the example of custom getters and setters, it would be something like this:
Store
// ...
getters: {getUserField(state){returngetField(state.user);},},mutations: {updateUserField(state,field){updateField(state.user,field);},},actions: {updateAsyncUserField(state,field){// Async task like a call to some APIupdateField(state.user,field);}}
Hi!
Sorry if this a very basic question. From the examples in the docs and the source code, I guess I only can fire mutations when a property is set. What about actions? What if I always wanto to call some API before making a mutation? In the example of custom getters and setters, it would be something like this:
Store
Component
The text was updated successfully, but these errors were encountered: