123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- Vue.use(VueRouter)
- const routes = [
- {
- path: '/',
- name: 'Layout',
- component: () => import('../views/layout/index.vue'),
- redirect: { name: 'Home' },
- children: [
- {
- path: '/Layout/Home',
- name: 'Home',
- component: () => import('../views/Home/index.vue'),
- meta: { myName: 'Home' },
- },
- // Visit页面
- {
- path: '/Layout/Visit',
- name: 'Visit',
- component: () => import('../views/Visit/index.vue'),
- meta: { myName: 'Visit' },
- redirect: { name: 'Visit1' },
- children: [
- {
- path: '/Layout/Visit/1',
- name: 'Visit1',
- component: () => import('../views/Visit/Visit1.vue'),
- meta: { myName: 'Visit', nameAll: 'Hours, Direction & Admission' },
- },
- {
- path: '/Layout/Visit/2',
- name: 'Visit2',
- component: () => import('../views/Visit/Visit2.vue'),
- meta: { myName: 'Visit', nameAll: 'Reservation' },
- },
- {
- path: '/Layout/Visit/3',
- name: 'Visit3',
- component: () => import('../views/Visit/Visit3.vue'),
- meta: { myName: 'Visit', nameAll: 'Floor Plans' },
- },
- {
- path: '/Layout/Visit/4',
- name: 'Visit4',
- component: () => import('../views/Visit/Visit4.vue'),
- meta: { myName: 'Visit', nameAll: 'Audio Guide & Tour' },
- },
- {
- path: '/Layout/Visit/5',
- name: 'Visit5',
- component: () => import('../views/Visit/Visit5.vue'),
- meta: { myName: 'Visit', nameAll: 'Accessibility' },
- },
- {
- path: '/Layout/Visit/6',
- name: 'Visit6',
- component: () => import('../views/Visit/Visit6.vue'),
- meta: { myName: 'Visit', nameAll: 'Café & Shop' },
- },
- {
- path: '/Layout/Visit/7',
- name: 'Visit7',
- component: () => import('../views/Visit/Visit7.vue'),
- meta: { myName: 'Visit', nameAll: 'Visitor Guidelines' },
- },
- ]
- },
- // 列表Exhibitions页面
- {
- path: '/Layout/Exhibitions/:id',
- name: 'Exhibitions',
- component: () => import('../views/Exhibitions/index.vue'),
- meta: { myName: 'Exhibitions' },
- },
- // 列表Exhibitions详情页面
- {
- path: '/Layout/ExhibitionsInfo',
- name: 'ExhibitionsInfo',
- component: () => import('../views/Exhibitions/info.vue'),
- meta: { myName: 'Exhibitions' },
- },
- // Collections页面
- {
- path: '/Layout/Collections/:id',
- name: 'Collections',
- component: () => import('../views/Collections/index.vue'),
- meta: { myName: 'Collections' },
- },
- // LearnEngage页面
- {
- path: '/Layout/LearnEngage/:id',
- name: 'LearnEngage',
- component: () => import('../views/LearnEngage/index.vue'),
- meta: { myName: 'Learn & Engage' },
- },
- // LearnEngage详情页面
- {
- path: '/Layout/LearnEngageInfo',
- name: 'LearnEngageInfo',
- component: () => import('../views/LearnEngage/info.vue'),
- meta: { myName: 'Learn & Engage' },
- },
- // Publications页面
- {
- path: '/Layout/Publications',
- name: 'Publications',
- component: () => import('../views/Publications/index.vue'),
- meta: { myName: 'Publications' },
- redirect: { name: 'Publications1' },
- children: [
- {
- path: '/Layout/Publications/1',
- name: 'Publications1',
- component: () => import('../views/Publications/Publications1.vue'),
- meta: { myName: 'Publications', nameAll: 'Magazines' },
- },
- {
- path: '/Layout/PublicationsInfo',
- name: 'PublicationsInfo',
- component: () => import('../views/Publications/PublicationsInfo.vue'),
- meta: { myName: 'Publications', nameAll: 'Magazines' },
- },
- {
- path: '/Layout/Publications/2',
- name: 'Publications2',
- component: () => import('../views/Publications/Publications2.vue'),
- meta: { myName: 'Publications', nameAll: 'Exhibition Catalogues' },
- },
- {
- path: '/Layout/Publications/3',
- name: 'Publications3',
- component: () => import('../views/Publications/Publications3.vue'),
- meta: { myName: 'Publications', nameAll: 'Research' },
- },
- ]
- },
- // JoinSupport页面
- {
- path: '/Layout/JoinSupport',
- name: 'JoinSupport',
- component: () => import('../views/JoinSupport/index.vue'),
- meta: { myName: 'Join & Support' },
- redirect: { name: 'Volunteer' },
- children: [
- {
- path: '/Layout/JoinSupport/Volunteer',
- name: 'Volunteer',
- component: () => import('../views/JoinSupport/Volunteer.vue'),
- meta: { myName: 'Join & Support', nameAll: 'Volunteer' },
- },
- {
- path: '/Layout/JoinSupport/VolunteerInfo',
- name: 'VolunteerInfo',
- component: () => import('../views/JoinSupport/VolunteerInfo.vue'),
- meta: { myName: 'Join & Support', nameAll: 'Volunteer' },
- },
- {
- path: '/Layout/JoinSupport/Give',
- name: 'Give',
- component: () => import('../views/JoinSupport/Give.vue'),
- meta: { myName: 'Join & Support', nameAll: 'Give' },
- },
- {
- path: '/Layout/JoinSupport/GiveInfo',
- name: 'GiveInfo',
- component: () => import('../views/JoinSupport/GiveInfo.vue'),
- meta: { myName: 'Join & Support', nameAll: 'Give' },
- },
- ]
- },
- //About页面
- {
- path: '/Layout/About',
- name: 'About',
- component: () => import('../views/About/index.vue'),
- meta: { myName: 'About' },
- },
- {
- path: '/Layout/About/Director',
- name: 'Director',
- component: () => import('../views/About/Director.vue'),
- meta: { myName: 'About' },
- },
- {
- path: '/Layout/About/link',
- name: 'AboutLink',
- component: () => import('../views/About/link.vue'),
- meta: { myName: 'About' },
- },
- ]
- }
- ]
- const router = new VueRouter({
- // mode: 'history',
- base: process.env.BASE_URL,
- routes
- })
- // 导航守卫,回到页面顶部
- router.beforeEach((to, from, next) => {
- document.documentElement.scrollTop = 0
- next()
- })
- export default router
|