Vue-router initialization, routes fetches data from sessionStorage, but cannot record it

let constantRouter = sessionStorage.getItem("TOTAL")?JSON.parse(sessionStorage.getItem("TOTAL")):[
    {
        path: "/login",
        name: "login",
        component: login
    },
    {
        path: "/",
        name: "defaultLogin",
        component: login
    }
]

const router = new Router({
    linkActiveClass: "active",
    routes: constantRouter
})

so that new Router cannot load the data of sessionStorage

Oct.23,2021

  1. I don't know what your requirements are, but the design itself is unreasonable.
  2. sessionStorage should the name of the route be stored or some other unique identity? And sessionStorage closes the browser window or the tab is gone, is it just to refresh that?
  3. I don't know what the data you pulled out
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c53e-2c2fa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c53e-2c2fa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?