import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import ModeOne from '../layouts/index.vue'

Vue.use(VueRouter)
export const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'App_Main',
    component: ModeOne,
    redirect:'/Home',
    children:[
      {
        path: '/Home',
        name: 'Home',
        component: ()=>import('@/views/Home.vue'),
        meta:{
          text: '英雄版',
          icon: 'icon-yingxiongbang'
        },
        children: [
          {
            path: '/',
            name: 'Home',
            component: ()=>import('@/views/home/index.vue'),
          },
          {
            path: '/CommunityVote',
            name: 'CommunityVote',
            component: ()=>import('@/views/home/CommunityVote.vue'),
          },
          {
            path: '/Details',
            name: 'Details',
            component: ()=>import('@/views/home/Details.vue'),
          }
        ]
      },
      {
        path: '/Square',
        name: 'Square',
        component: ()=>import('@/views/Square.vue'),
        meta:{
          text: '广场',
          icon: 'icon-guangchang'
        }
      },

      {
        path: '/Initiate',
        name: 'Initiate',
        component: ()=>import('@/views/Initiate.vue'),
        meta:{
          text: '发起提案',
          icon: 'icon-faqi'
        }
      },
      {
        path: '/Mine',
        name: 'Mine',
        component: ()=>import('@/views/Mine.vue'),
        meta:{
          text: '我的',
          icon: 'icon-wode'
        }
      },
    ]
  }
]



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


export default router
