feat: 流程详情页打开后,关闭跳回对应的列表页
This commit is contained in:
@ -32,12 +32,16 @@ export function setupRouterGuard(router: Router) {
|
||||
function createPageGuard(router: Router) {
|
||||
const loadedPageMap = new Map<string, boolean>();
|
||||
|
||||
router.beforeEach(async (to) => {
|
||||
router.beforeEach(async (to, from) => {
|
||||
// The page has already been loaded, it will be faster to open it again, you don’t need to do loading and other processing
|
||||
to.meta.loaded = !!loadedPageMap.get(to.path);
|
||||
// Notify routing changes
|
||||
setRouteChange(to);
|
||||
|
||||
const toPath = to.path;
|
||||
if (toPath.indexOf('views/secondDev') >= 0 || toPath.indexOf('/viewForm') >= 0) {
|
||||
// 记录从哪里来的 关闭页面的时候好跳回去
|
||||
localStorage.setItem('parentRoutePath', from.path);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user