mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 22:30:19 +08:00
feat(projects): 添加页面缓存、记录在tab中的缓存页面的滚动条位置
This commit is contained in:
@@ -2,6 +2,7 @@ import type { App } from 'vue';
|
||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
||||
import { transformAuthRoutesToVueRoutes } from '@/utils';
|
||||
import { constantRoutes } from './routes';
|
||||
import { scrollBehavior } from './helpers';
|
||||
import { createRouterGuard } from './guard';
|
||||
|
||||
const createHistoryFunc = import.meta.env.VITE_IS_VERCEL === '1' ? createWebHashHistory : createWebHistory;
|
||||
@@ -9,7 +10,7 @@ const createHistoryFunc = import.meta.env.VITE_IS_VERCEL === '1' ? createWebHash
|
||||
export const router = createRouter({
|
||||
history: createHistoryFunc(import.meta.env.BASE_URL),
|
||||
routes: transformAuthRoutesToVueRoutes(constantRoutes),
|
||||
scrollBehavior: () => ({ left: 0, top: 0 })
|
||||
scrollBehavior
|
||||
});
|
||||
|
||||
export async function setupRouter(app: App) {
|
||||
|
||||
Reference in New Issue
Block a user