Is there any better guide available for using Vuex? #11473
-
|
Hi guy's is there any tutorial or guide for using Vuex in quasar ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
What's wrong with the guide? |
Beta Was this translation helpful? Give feedback.
-
|
The guide is only for making VUEX work in Quasar. You could always refer to VUEX docs for use cases. |
Beta Was this translation helpful? Give feedback.
-
It turned out that the OP actually wants to know how to define multiple mutations, and here is the answer: // The guide shows a similar mutation
export const toggleDrawerState = (state) => {
state.drawerState = !state.drawerState;
};
// So, just add more of them if you want to add more of them, ? :)
export const resetWhatever = (state) => {
state.whatever = 'hehehe';
};
// With a payload
export const setWhatever = (state, value) => {
state.whatever = value === 'hehehe' ? value : value.toLowerCase();
}; |
Beta Was this translation helpful? Give feedback.
It turned out that the OP actually wants to know how to define multiple mutations, and here is the answer: