I have a state variable in store Vuex like this:
let state = {
order: {
payment_method: 'Credit card',
}
};
export default state;
Then, my template:
<select id="payment_method" class="w-full form-control form-select"
v-model="order.payment_method">
<option value="Credit Card">Credit Card</option>
<option value="COD">COD</option>
</select>
When I change my select option, my state order
will be updated. However, should I do that, because when I read the Vuex store principle, it said I shouldn't update the state value directly? Is that the way I am doing in the above code?
If I shouldn't do that, how will I get the value from the selection option?