{"size": 1665, "ext": "js", "max_stars_repo_path": "frontend/src/router/index.js", "max_stars_repo_name": "CelebrateYourself/cells", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "frontend/src/router/index.js", "max_issues_repo_name": "CelebrateYourself/cells", "max_issues_repo_issues_event_min_datetime": "2021-08-06T17:45:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T18:06:24.000Z", "max_forks_repo_path": "frontend/src/router/index.js", "max_forks_repo_name": "CelebrateYourself/cells", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 13, "max_forks_count": null, "avg_line_length": 21.0759493671, "max_line_length": 69, "alphanum_fraction": 0.4750750751}
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const router = new VueRouter({
  mode: 'history',  
  
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: { name: 'squares' },
    },

    {
      path: '/screen/',
      name: 'screen',
      component: () => import('../components/ScreenPage'),
      props: true,
    },
    
    {
      path: '/squares/',
      component: () => import('../components/SquaresPage'),
      children: [
        {
          path: '',
          name: 'squares',
          redirect: { name: 'squares-map-list' },
        },
        {
          path: 'maps',
          name: 'squares-map-list',
          component: () => import('../components/SquaresMapList'),
        },
        {
          path: 'maps/create',
          name: 'squares-map-create',
          component: () => import('../components/SquaresMapCreate'),
        },
        {
          path: 'maps/:slug',
          name: 'squares-map-detail',
          component: () => import('../components/SquaresMapDetail'),
        }
      ],
    },

    // Default
    {
      path: '/error',
      name: 'error',
      component: () => import('../components/ErrorPage'),
      props: true,
    },
    {
      path: '*',
      redirect: {
        name: 'error',
        params: {status: 404, statusText: 'Not Found'},
        props: true
      },      
    }
  ]  // routes
})

/* 
// Set title as result of function call from {..., meta: {title: fn}}
router.afterEach((to) => {
    let title = 'Project'
    if(to.meta && to.meta.title){
      title = to.meta.title(to)
    }
    document.title = title
})
*/

export default router