Hey there! I have a method that adjusts the state of Vuex by either adding or subtracting from it. The main purpose of this method is to manipulate the state in Vuex.
setStep(state, type) {
state.currentStep++;
}
However, I need to be able to pass the --
or ++
dynamically to it. How can I make this happen?
I attempted the following:
setStep(state, type = ++ or --) {
state.currentStep[type];
}
Unfortunately, I did not achieve the desired result with this approach. Do you have any suggestions on how I can accomplish this dynamic adjustment?