import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: `/`,
    redirect: `/page1`,
  },
  {
    path: `/login`,
    name: `Login`,
    component: () => import(`@/views/Login.vue`),
    meta: {
      title: `登录界面`,
    },
  },
  {
    path: `/page1`,
    name: `page1`,
    component: () => import(`@/views/page1/index.vue`),
    meta: {
      title: `综合问览`,
    },
  },
  {
    path: `/page2`,
    name: `page2`,
    component: () => import(`@/views/page2/index.vue`),
    meta: {
      title: `种植分析`,
    },
  },
  {
    path: `/page3`,
    name: `page3`,
    component: () => import(`@/views/page3/index.vue`),
    meta: {
      title: `种植分析详情`,
    },
  },
]

const router = new VueRouter({
  mode: `hash`,
  base: process.env.BASE_URL,
  routes,
})

export default router
