Home > front end >  How to switch routing in VUE remained after page state??????
How to switch routing in VUE remained after page state??????

Time:10-17

As shown in figure: when I again in the text box input, and then jump to other pages, and how do I switch back to the page text box, text box content still retained,

CodePudding user response:

 

/* package routing, cached page */




CodePudding user response:

BeforeRouteLeave (to, from, next) {
This. Global. SaveQuery (this, this. $route. The path).
next();
},

CodePudding user response:

Const saveQuery=function (app, path) {
Let routeKey=getRouteKey (path);
If (app. Query) {
Let the key="q_" + routeKey;
SetObj (key, app. Query);
}
If (app. Page) {
Let the key="page_" + routeKey;
Store. The set (key, app. Page);
}
}


Encapsulates a js
  • Related