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: '/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'
        },
        children: [
          {
            path: '/Mine',
            name: 'Mine',
            component: ()=>import('@/views/mine/index.vue'),
          },
        ]
      },
    ],
  },
  {
    path: '/Home/CommunityVote',
    name: 'CommunityVote',
    component: ()=>import('@/views/home/CommunityVote.vue'),
  },
  {
    path: '/Home/Details',
    name: 'Details',
    component: ()=>import('@/views/home/Details.vue'),
  },
  {
    path:'/Initiate/Member',
    name:'Mimber',
    component: ()=>import('@/views/initiate_comp/MenberPage.vue'),
    meta:{
      text:"设置成员"
    }
  },
  {
    path:'/Square/SquareVote',
    name:'SquareVote',
    component: ()=>import('@/views/square/SquareVote.vue'),
  },
  {
    path:'/Square/SquareDetails',
    name:'SquareDetails',
    component: ()=>import('@/views/square/SquareDetails.vue'),
  },
  {
    path: '/Mine/MineEdit',
    name: 'MineEdit',
    component: ()=>import('@/views/mine/MineEdit.vue'),
    meta:{
      text:"编辑"
    }
  },
  {
    path: '/Mine/MyInitiate',
    name: 'MyInitiate',
    component: ()=>import('@/views/mine/MyInitiate.vue'),
    meta:{
      text:"重新发起"
    }
  },
  {
    path: '/Mine/MyCommunity',
    name: 'MyCommunity',
    component: ()=>import('@/views/mine/MyCommunity.vue'),
  },
  {
    path: '/Mine/MyProject',
    name: 'MyProject',
    component: ()=>import('@/views/mine/MyProject.vue'),
  },
  {
    path: '/Mine/Transfer',
    name: 'Transfer',
    component: ()=>import('@/views/mine/Transfer.vue'),
  },
  {
    path: '/Mine/AttendCommunity',
    name: 'AttendCommunity',
    component: ()=>import('@/views/mine/AttendCommunity.vue'),
  },
  {
    path: '/Mine/AttendProject',
    name: 'AttendProject',
    component: ()=>import('@/views/mine/AttendProject.vue'),
  },
  {
    path:'/Browser/Index',
    name:'Index',
    component: ()=>import('@/views/browser/index.vue'),
  },
  {
    path:'/Browser/VoteHash',
    name:'VoteHash',
    component: ()=>import('@/views/browser/VoteHash.vue'),
  },
  {
    path:'/Browser/PersonVote',
    name:'PersonVote',
    component: ()=>import('@/views/browser/PersonVote.vue'),
  },
  {
    path:'/Browser/ProjectDetails',
    name:'ProjectDetails',
    component: ()=>import('@/views/browser/ProjectDetails.vue'),
  },
  {
    path:'/Browser/MyAttend',
    name:'MyAttend',
    component: ()=>import('@/views/browser/MyAttend.vue'),
  },
]



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


export default router
