import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home'

Vue.use(VueRouter)
// keepAlive先全部为true 后期根据每个页面需求调整
const routes = [
  // 首页
  {
    path: '/',
    name: 'home',
    component: Home,
    meta:{
      keepAlive:false
    }
  },
  // 精品展
  {
    path: '/boutique',
    name: 'about',
    component: () => import('@/views/boutique'),
    meta:{
      keepAlive:true
    }
  },
  // 虚拟展厅
  {
    path: '/virtual',
    name: 'virtual',
    component: () => import('@/views/virtual'),
    meta:{
      keepAlive:true
    }
  },
  // 布展
  {
    path: '/display',
    name: 'display',
    component: () => import('@/views/display'),
    meta:{
      keepAlive:true
    }
  },
  // 布展详情页
  {
    path: '/display/:exhibitionId',
    name: 'displayDetail',
    component: () => import('@/views/display/Detail.vue'),
    meta:{
      keepAlive:false
    }
  },
  // 文物展
  {
    path: '/culturalRelic',
    name: 'culturalRelic',
    component: () => import('@/views/culturalRelic'),
    meta:{
      keepAlive:true
    }
  },
  // 文物详情页
  {
    path: '/culturalRelic/:crId',
    name: 'culturalRelicDetail',
    component: () => import('@/views/culturalRelic/Detail.vue'),
    meta:{
      keepAlive:false
    }
  },
  // 个人中心
  {
    path: '/personal',
    name: 'personal',
    component: () => import('@/views/personal'),
    meta:{
      keepAlive:true
    }
  },
  // 登录
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login'),
    meta:{
      keepAlive:true
    }
  },

  // 注册页
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/register'),
    meta:{
      keepAlive:true
    }
  },
  // 博物馆
  {
    path: '/museum',
    name: 'museum',
    component: () => import('@/views/museum'),
    meta:{
      keepAlive:true
    }
  },
  // 博物馆详情
  {
    path: '/museum/:id',
    name: 'museum',
    component: () => import('@/views/museum/Detail.vue'),
    meta:{
      keepAlive:false
    }
  },
]

const router = new VueRouter({
  routes
})

export default router
