import { createRouter, createWebHashHistory } from 'vue-router'

let history = createWebHashHistory()
// let history = createWebHistory('/admin')

let routes = [
  {
    path: '/',
    name: 'UserAccount',
    redirect: '/list'
  },
  {
    path: '/list',
    name: 'List',
    component: ()=> import("../index.vue")
  },
]

const router = createRouter({ 
  history, 
  routes,
  scrollBehavior(to, from, savedPosition) {
    return { top: 0 };
  }
 })

// router.beforeEach((to, from, next)=>{
  // if( to.meta.isAuth === true && !Cookies.get('token')){
  //   return next({name: 'Login'})
  // }
//   return next()
// })

export default router