import Vue from 'vue'
import App from '@/layout/MainPage/index.vue'
import VueRouter, { RouteConfig } from 'vue-router'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'LayOne',
    component: App,
    redirect:'/home',
    children:[
      {
        path:'/home',
        name: '首页',
        component: ()=>import('@/views/Home.vue')
      },
      {
        path:'/newsList',
        name: '新闻公告',
        component: ()=>import('@/views/newsList.vue')
      },
      {
        path:'/newsDetails',
        name: '首页',
        component: ()=>import('@/views/newsDetails.vue')
      }
    ]
  }
]

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

export default router
