Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

75
Views
SessionStorage Slow Loading

I'm using SessionStorage data to display the username on the screen. The name should load after login, but the information is only loaded when I refresh the page (clicking on reload). Does anyone know why?

    HTML
    <cv-header-name to="/"> Welcome {{ userName }}</cv-header-name>


    VUE
      data: function () {
       return {
       userName: [],
       };
      },
      mounted() {
        if(sessionStorage.getItem('name')) {
      try {
        this.userName = JSON.parse(sessionStorage.getItem('name'))
      }catch (error) {
        sessionStorage.removeItem('name')
      }
    }
    }

Before refresh enter image description here

After refresh enter image description here

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs