feat: add main app route skeleton
This commit is contained in:
@@ -1,13 +1,72 @@
|
||||
import { createRouter, createWebHashHistory} from 'vue-router'
|
||||
import MainPage from '../components/Main/Index.vue'
|
||||
import SecondPage from '../pages/Home/Index.vue'
|
||||
import { createRouter, createWebHashHistory, type RouteRecordRaw } from 'vue-router'
|
||||
|
||||
const routes = [
|
||||
{ path: '/', component: MainPage },
|
||||
{ path: '/second', component: SecondPage }
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: () => import('../modules/auth/LoginPage.vue'),
|
||||
},
|
||||
{
|
||||
path: '/second',
|
||||
name: 'second',
|
||||
component: () => import('../pages/Home/Index.vue'),
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: () => import('../layouts/MainLayout.vue'),
|
||||
redirect: '/dashboard',
|
||||
children: [
|
||||
{
|
||||
path: 'dashboard',
|
||||
name: 'dashboard',
|
||||
component: () => import('../modules/dashboard/DashboardPage.vue'),
|
||||
},
|
||||
{
|
||||
path: 'image-optimizer',
|
||||
name: 'image-optimizer',
|
||||
component: () => import('../modules/image-optimizer/ImageOptimizerPage.vue'),
|
||||
},
|
||||
{
|
||||
path: 'business/image-optimizer',
|
||||
redirect: '/image-optimizer',
|
||||
},
|
||||
{
|
||||
path: 'logs',
|
||||
name: 'logs',
|
||||
component: () => import('../modules/logs/LogsPage.vue'),
|
||||
},
|
||||
{
|
||||
path: 'logs/audit',
|
||||
redirect: '/logs',
|
||||
},
|
||||
{
|
||||
path: 'logs/app',
|
||||
redirect: '/logs',
|
||||
},
|
||||
{
|
||||
path: 'statistics',
|
||||
name: 'statistics',
|
||||
component: () => import('../modules/statistics/StatisticsPage.vue'),
|
||||
},
|
||||
{
|
||||
path: 'settings',
|
||||
name: 'settings',
|
||||
component: () => import('../modules/settings/SettingsPage.vue'),
|
||||
},
|
||||
{
|
||||
path: 'components',
|
||||
name: 'components',
|
||||
component: () => import('../modules/components-demo/ComponentsDemoPage.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
redirect: '/dashboard',
|
||||
},
|
||||
]
|
||||
|
||||
export default createRouter({
|
||||
history: createWebHashHistory(), // Use createWebHashHistory for hash-based routing
|
||||
history: createWebHashHistory(),
|
||||
routes
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user