I'm new to Vue.js and I have created an edit profile page where users can edit basic information like:
- First Name
- Last Name
Example Of Input:
<b-col sm="6">
<b-form-group
label="First Name"
label-for="firstName"
>
<validation-provider
#default="{ errors }"
name="First Name"
rules="required"
>
<b-form-input
id="firstName"
v-model="firstName"
placeholder="First Name"
name="firstName"
/>
<small class="text-danger">{{ errors[0] }}</small>
</validation-provider>
</b-form-group>
</b-col>
Now I'm loading user value from the state value like this:
data() {
return {
firstName: '',
lastName: '',
email: '',
required,
}
},
mounted() {
this.firstName = this.$store.state.authUser.user.firstName
this.lastName = this.$store.state.authUser.user.lastName
this.email = this.$store.state.authUser.user.email
},
It's working perfectly and showing value in the input. But when the user hits the hard refresh the values are gone from all the inputs.
Any idea how to resolve this problem? I can't find any way as I'm new in Vue.js and working on the first project.
Thanks