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

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/book',
    name: 'Book',
    component: () => import('../views/Book.vue'),
    meta:{
      // title:"新思课堂电子书阅读"
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login.vue'),
    meta:{
      // title:"新思课堂电子书阅读"
    }
  },
  {
    path: '/test',
    name: 'Test',
    component: () => import('../views/Test.vue'),
    meta:{
      // title:"新思课堂电子书阅读"
    }
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/About.vue')
  },
  {
    path: '/cyc',
    name: 'Cyc',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/Cyc.vue')
  }
]
// base: process.env.NODE_ENV == "sub"? process.env.VUE_APP_BASE_URL:""
const router = new VueRouter({
  mode: 'history',
  base: process.env.VUE_APP_BASE_URL,
  // base: "/dist/",
  routes
})

export default router
