import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: () => import(/* webpackChunkName: "Mobile" */ "@/views/home"),
    meta: { index: 0 }
  },
  {
    path: "/shopping",
    name: "shopping",
    component: () =>
      import(/* webpackChunkName: "Mobile" */ "@/views/shopping"),
    meta: { index: 1 }
  }
];

const router = new VueRouter({
  routes
});

router.afterEach(() => {
  window.scrollTo(0, 0);
});
export default router;
