For our form to continue to work with Vuelidate alongside Vuex, we are going to have to make some adjustments to how we have our data set up for two-way binding on our inputs. Don't worry, we'll take it step by step. Now that we have Vuex incorporated into our app, we want our form to use our global state instead of the local state we had in our data() { form: {...} } inside App.vue. So, we need to make some changes in our template to tell the two-way binding to use Vuex instead.
We are going to remove all of the v-model statements from the inputs in our form. Instead, we are going to manually create our two-way bindings by setting up the :value bind and the @input listener.
First, we will create a new method called updateUser, which will receive two parameters, as follows:
- The first one will be property in our form that is getting updated, for...