import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name:'login',
      component: () => import('@/page/login'), 
    },
    {
      path: '/login',
      name:'login',
      component: () => import('@/page/login'), 
    },
    { path: '/main', component:()=> import('@/page/main'),
      children: [
          {
            path: 'chat',
            component:()=> import('@/page/main/chat/chat.vue')
          },
          {
            path: 'friend',
            component:()=> import('@/page/main/friend/friend.vue')
          },
          {
            path: 'my',
            component:()=> import('@/page/main/friend/friend.vue') 
          }
      ]
    }
  ],
  linkActiveClass: 'active'
})
router.push({ path: '/login' });
export default router