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

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: () => import(/* webpackChunkName: 'wxhome' */ 'pages/home')
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import(/* webpackChunkName: 'wxlogin' */ 'pages/login')
    },
    {
      path: '/home',
      name: 'Home',
      component: () => import(/* web packChunkName: 'wxhome' */ 'pages/home'),
      children: [
        {
          path: '/marketing',
          name: 'marketing',
          component: () =>
            import(/* webpackChunkName: 'marketing' */ 'pages/marketing-center')
        },
        {
          path: '/addmarketing',
          name: 'addmarketing',
          component: () =>
            import(/* webpackChunkName: 'wxlogin' */ 'pages/addmarketing')
        }
      ]
    }
  ]
})
