添加项目文件。
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import HomeView from '@/views/HomeView.vue'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: HomeView,
|
||||
meta: { title: '激光诱导击穿光谱 元素分析系统' },
|
||||
},
|
||||
{
|
||||
path: '/sample',
|
||||
name: 'sample',
|
||||
component: () => import('@/views/SampleSetupView.vue'),
|
||||
meta: { title: '放置待测样品' },
|
||||
},
|
||||
{
|
||||
path: '/scan',
|
||||
name: 'scan',
|
||||
component: () => import('@/views/ScanPlanView.vue'),
|
||||
meta: { title: '样品轮廓识别与激光点位规划' },
|
||||
},
|
||||
{
|
||||
path: '/spectrum',
|
||||
name: 'spectrum',
|
||||
component: () => import('@/views/SpectrumView.vue'),
|
||||
meta: { title: '光谱数据采集与分析' },
|
||||
},
|
||||
{
|
||||
path: '/result',
|
||||
name: 'result',
|
||||
component: () => import('@/views/ResultView.vue'),
|
||||
meta: { title: '检测完成' },
|
||||
},
|
||||
{
|
||||
path: '/pay',
|
||||
redirect: { name: 'sample' },
|
||||
},
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
redirect: { name: 'home' },
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
router.afterEach((to) => {
|
||||
document.title = (to.meta.title as string | undefined) ?? 'LIBS Lab'
|
||||
})
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user