Check out this code snippet I have:
export default new Vuex.Store({
state: {
bottles: 20,
disabledBtn: false
},
mutations: {
REMOVE_BOTTLES(state) {
if (state.bottles > 0) {
state.bottles--;
}
},
ADD_BOTTLES(state, items) {
state.bottles = state.bottles + items
}
},
actions: {
removeOneBottle ({commit}) {
commit('REMOVE_BOTTLES');
},
addBottlesInput ({commit}, items) {
commit('ADD_BOTTLES', items);
}
}
})
I am looking for a solution to update the state with the newly entered value. The mutation adds numbers received as strings, but I would like it to process numerical values passed through the input field. Any help on this matter would be highly appreciated.