index.js 1.76 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 47
        {
          path: 'centers',
          name: 'Centros',
          component: () => import('@/views/about/Index.vue'),
krlsnvz93's avatar
krlsnvz93 committed
48
          meta: { src: require('@/assets/about.jpg') },
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
49 50 51 52 53
        },
        {
          path: 'patients',
          name: 'Pacientes',
          component: () => import('@/views/contact-us/Index.vue'),
krlsnvz93's avatar
krlsnvz93 committed
54
          meta: { src: require('@/assets/contact.jpg') },
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
55 56 57 58 59
        },
        {
          path: 'pro',
          name: 'Directores',
          component: () => import('@/views/pro/Index.vue'),
krlsnvz93's avatar
krlsnvz93 committed
60
          meta: { src: require('@/assets/pro.jpg') },
Yoelvis Gonzalez's avatar
Yoelvis Gonzalez committed
61 62 63 64 65 66 67 68 69 70 71 72
        },
        {
          path: '*',
          name: 'FourOhFour',
          component: () => import('@/views/404/Index.vue'),
        },
      ],
    },
  ],
})

export default router