import Vue from 'vue'
import Router from 'vue-router'
import Login from './views/login'
import Layout from './views/layout.vue';
 

Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/login',
      name:'Login',
      component:Login
    },
    {
      path:'/',
      name:'Layout',
      component:Layout,
      redirect:'/product',
      meta:{
        requiresAuth:true
      },
      children:[
        {
          path:'product',
          name:"Product",
          component:() => import('./views/product'),
          meta:{
            requiresAuth:true
          }
        },
        {
          path:'params',
          name:"Params",
          component:()=> import("./views/params"),
          meta:{
            requiresAuth:true
          }
        },
        {
          path:'content',
          name:'Content',
          component: () => import("./views/content"),
          meta:{
            requiresAuth:true
          }
        }
      ]

    },
    {
      path:"/user",
      name:'User',
      component:()=> import ('./views/user'),
      meta:{
        requiresAuth:true
      }
    }
  ]
})
