When vue.js logs in to the website for the first time, clicking the enter key on the keyboard will cause the page route to jump to the root path. Refreshing the page and then pressing enter will not jump.

vue.js first login website click the keyboard enter key will cause the page route to jump to the root path, refresh the page and then press enter will not jump, this is how to return a responsibility?
the following is my route interception
/ / Route interception
router.beforeEach ((to, from, next) = > {
if (to.path ="/"| | to.path ="/ register" | | to.path ="/ resetpwd") {

next()

} else if (! window.sessionStorage.token) {

router.push("/")

} else {

next()

}
})

Sep.27,2021

you need to see where your enter key is captured, where is the focus of the page when it jumps, and where is the focus after refresh


where is the @ keyup.enter= "function" statement?

Menu