bt-yjj-system-examination-web/src/router/index.js

95 lines
1.9 KiB
JavaScript
Raw Normal View History

2021-05-08 17:27:56 +08:00
import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/pages/Index/Index'
import Notice from '@/pages/Notice/Notice'
import Policy from '@/pages/Policy/Policy'
import Train from '@/pages/Train/Train'
import Detail from '@/pages/Detail/Detail'
import Public from '@/pages/Public/Public'
import PersonCenter from '@/pages/PersonCenter/PersonCenter'
import Question from '@/pages/Question/Question'
import Login from '@/pages/Login/Login'
import Register from '@/pages/Register/Register'
2021-05-13 13:33:58 +08:00
import Test from '@/pages/Test/Test'
2022-06-08 16:47:46 +08:00
import CommonProblem from '@/pages/CommonProblem/CommonProblem'
import ForgetPassword from '@/pages/ForgetPassword/ForgetPassword'
2021-05-08 17:27:56 +08:00
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'Index',
component: Index
},
{
path: '/notice',
name: 'Notice',
component: Notice
},
{
path: '/policy',
name: 'Policy',
component: Policy
},
{
path: '/train',
name: 'Train',
component: Train
},
{
path: '/detail',
name: 'Detail',
component: Detail
},
{
path: '/public',
name: 'Public',
component: Public
},
{
path: '/center',
name: 'PersonCenter',
component: PersonCenter
},
{
path: '/question',
name: 'Question',
component: Question
},
{
path: '/login',
name: 'Login',
component: Login
},
{
path: '/register',
name: 'Register',
component: Register
2021-05-13 13:33:58 +08:00
},
{
path: '/test',
name: 'Test',
component: Test
2022-06-08 16:47:46 +08:00
},
{
path: '/common',
name: 'CommonProblem',
component: CommonProblem
},
{
path: '/forget',
name: 'ForgetPassword',
component: ForgetPassword
2021-05-13 13:33:58 +08:00
}
],
scrollBehavior(to, from, saveTop) {
if (saveTop) {
return saveTop;
} else {
return { x: 0, y: 0 }
2021-05-08 17:27:56 +08:00
}
2021-05-13 13:33:58 +08:00
},
2021-05-08 17:27:56 +08:00
})