first commit
This commit is contained in:
47
src/router/index.js
Normal file
47
src/router/index.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
import ListView from '../views/ListView.vue'
|
||||
import SettingsView from '../views/SettingsView.vue'
|
||||
import AddEntryView from '../views/AddEntryView.vue'
|
||||
|
||||
// TODO: 后续补充真实的分析页实现,这里先占位
|
||||
const AnalysisView = () => import('../views/AnalysisView.vue').catch(() => null)
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: HomeView,
|
||||
meta: { tab: 'home' },
|
||||
},
|
||||
{
|
||||
path: '/list',
|
||||
name: 'list',
|
||||
component: ListView,
|
||||
meta: { tab: 'list' },
|
||||
},
|
||||
{
|
||||
path: '/analysis',
|
||||
name: 'analysis',
|
||||
component: AnalysisView,
|
||||
meta: { tab: 'analysis' },
|
||||
},
|
||||
{
|
||||
path: '/settings',
|
||||
name: 'settings',
|
||||
component: SettingsView,
|
||||
meta: { tab: 'settings' },
|
||||
},
|
||||
{
|
||||
path: '/add',
|
||||
name: 'add',
|
||||
component: AddEntryView,
|
||||
meta: { overlay: true },
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user