simplify route structure by moving AppLayout to root path
This commit is contained in:
parent
f494f32a20
commit
b43502ec69
@ -125,7 +125,7 @@ const breadcrumbItems = computed(() => {
|
|||||||
if (route.meta?.toolName) {
|
if (route.meta?.toolName) {
|
||||||
// 工具路由:显示 Tools / 工具名称
|
// 工具路由:显示 Tools / 工具名称
|
||||||
// 自动解析 Tools 路由的路径(用于面包屑链接)
|
// 自动解析 Tools 路由的路径(用于面包屑链接)
|
||||||
let toolsPath = '/app/tools' // 默认值
|
let toolsPath = '/tools'
|
||||||
try {
|
try {
|
||||||
const resolved = router.resolve({ name: 'Tools' })
|
const resolved = router.resolve({ name: 'Tools' })
|
||||||
if (resolved.matched.length > 0) {
|
if (resolved.matched.length > 0) {
|
||||||
|
|||||||
@ -17,19 +17,19 @@ const router = createRouter({
|
|||||||
meta: { requiresAuth: false }
|
meta: { requiresAuth: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '',
|
||||||
name: 'HomePage',
|
name: 'HomePage',
|
||||||
component: () => import('../../views/HomePage.vue'),
|
component: () => import('../../views/HomePage.vue'),
|
||||||
meta: { requiresAuth: false }
|
meta: { requiresAuth: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/app',
|
path: '/',
|
||||||
name: 'AppLayout',
|
name: 'AppLayout',
|
||||||
component: () => import('../layouts/AppLayout.vue'),
|
component: () => import('../layouts/AppLayout.vue'),
|
||||||
meta: { requiresAuth: true },
|
meta: { requiresAuth: true },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: 'dashboard',
|
||||||
name: 'Dashboard',
|
name: 'Dashboard',
|
||||||
component: () => import('../../views/Dashboard.vue')
|
component: () => import('../../views/Dashboard.vue')
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user