This commit is contained in:
dap
2024-09-13 10:28:23 +08:00
35 changed files with 478 additions and 161 deletions

View File

@@ -19,7 +19,12 @@ const router = createRouter({
: createWebHistory(import.meta.env.VITE_BASE),
// 应该添加到路由的初始路由列表。
routes,
scrollBehavior: () => ({ left: 0, top: 0 }),
scrollBehavior: (to, _from, savedPosition) => {
if (savedPosition) {
return savedPosition;
}
return to.hash ? { behavior: 'smooth', el: to.hash } : { left: 0, top: 0 };
},
// 是否应该禁止尾部斜杠。
// strict: true,
});

View File

@@ -19,7 +19,12 @@ const router = createRouter({
: createWebHistory(import.meta.env.VITE_BASE),
// 应该添加到路由的初始路由列表。
routes,
scrollBehavior: () => ({ left: 0, top: 0 }),
scrollBehavior: (to, _from, savedPosition) => {
if (savedPosition) {
return savedPosition;
}
return to.hash ? { behavior: 'smooth', el: to.hash } : { left: 0, top: 0 };
},
// 是否应该禁止尾部斜杠。
// strict: true,
});

View File

@@ -15,15 +15,15 @@ const authStore = useAuthStore();
const MOCK_USER_OPTIONS: BasicOption[] = [
{
label: '超级管理员',
label: 'Super',
value: 'vben',
},
{
label: '管理员',
label: 'Admin',
value: 'admin',
},
{
label: '用户',
label: 'User',
value: 'jack',
},
];

View File

@@ -19,7 +19,12 @@ const router = createRouter({
: createWebHistory(import.meta.env.VITE_BASE),
// 应该添加到路由的初始路由列表。
routes,
scrollBehavior: () => ({ left: 0, top: 0 }),
scrollBehavior: (to, _from, savedPosition) => {
if (savedPosition) {
return savedPosition;
}
return to.hash ? { behavior: 'smooth', el: to.hash } : { left: 0, top: 0 };
},
// 是否应该禁止尾部斜杠。
// strict: true,
});

View File

@@ -15,15 +15,15 @@ const authStore = useAuthStore();
const MOCK_USER_OPTIONS: BasicOption[] = [
{
label: '超级管理员',
label: 'Super',
value: 'vben',
},
{
label: '管理员',
label: 'Admin',
value: 'admin',
},
{
label: '用户',
label: 'User',
value: 'jack',
},
];