index.js 1.88 KB
Newer Older
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
1 2 3
// Imports
import Vue from 'vue'
import Router from 'vue-router'
krlsnvz93's avatar
krlsnvz93 committed
4 5
import Vuelidate from 'vuelidate'
Vue.use(Vuelidate)
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

Vue.use(Router)

const router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  scrollBehavior: (to, from, savedPosition) => {
    if (to.hash) return { selector: to.hash }
    if (savedPosition) return savedPosition

    return { x: 0, y: 0 }
  },
  routes: [
    {
      path: '/',
      component: () => import('@/layouts/home/Login.vue'),
      children: [
        {
          path: '',
          name: 'Login',
          component: () => import('@/views/login/Login.vue'),
        },
      ],
    },
    {
      path: '',
      component: () => import('@/layouts/home/Index.vue'),
      children: [
        {
          path: 'home',
          name: 'Control',
          component: () => import('@/views/home/Index.vue'),
        },
krlsnvz93's avatar
krlsnvz93 committed
39 40 41 42 43
        {
          path: 'enter_patients',
          name: 'IngresarPacientes',
          component: () => import('@/views/patients/IngresarPacientes.vue'),
        },
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
44 45 46
        {
          path: 'centers',
          name: 'Centros',
47
          component: () => import('@/views/centers/Index.vue'),
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
48 49 50 51
        },
        {
          path: 'patients',
          name: 'Pacientes',
52 53 54 55 56 57
          component: () => import('@/views/patients-home/Index.vue'),
        },
        {
          path: 'admit',
          name: 'Confirmar',
          component: () => import('@/views/admit/Index.vue'),
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
58 59 60 61
        },
        {
          path: 'pro',
          name: 'Directores',
62
          component: () => import('@/views/directors/Index.vue'),
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
63
        },
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
64 65 66 67 68
        {
          path: 'register',
          name: 'Register',
          component: () => import('@/views/admin/Index.vue'),
        },
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
69 70 71 72 73 74 75 76 77 78 79
        {
          path: '*',
          name: 'FourOhFour',
          component: () => import('@/views/404/Index.vue'),
        },
      ],
    },
  ],
})

export default router