Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
Vue js my data lost after reloading my page

I have a page reload problem.
When I save on Vscode it works correctly on my html page, but when I refresh the page my data is undefined.
The data in the store works well, however it's just on the view profile that it doesn't work only after reloading my page.
If you have any suggestions, I'm a taker, I don't know what to do anymore.

views/Profil:

<div class="input-group mb-3">
            <span class="input-group-text" id="form-lastName">Nom :</span>
            <input
              type="text"
              class="form-control"
              aria-label="Username"
              v-model="lastName"
              ref="string"
            />
          </div>
          <div class="input-group mb-3">
            <span class="input-group-text" id="form-firstName">Prénom :</span>
            <input
              type="text"
              class="form-control"
              aria-label="Username"
              v-model="firstName"
              ref="string"
            />
          </div>


----------


export default {
  name: "ProfilC",
  data: function () {
    return {
      lastName: "",
      firstName: "",
      selectedFile: "",
    };
  },
  components: {
    NavbarC,
  },
  mounted: function () {
    this.lastName = this.$store.state.userInfos.user_lastName;
    this.firstName = this.$store.state.userInfos.user_firstName;


----------
sotre/index.js

const store = createStore({
  state: {
    status: '',
    user: user,
    userInfos: {
      nom: '',
      prenom: '',
      email: '',
      image: '',
    },
    dataArticles: [],
    dataComments: [],
    articleInfos: {
      message: '',
      image: '',
    },
    comments: [],
  },

  mutations: {
    
    userInfos: function (state, userInfos) {
      state.userInfos = userInfos;
    },
},

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I see your using vuex , did you install vuex persisted-state is saved the data on page reload

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!