const Router = VueRouter;
const routes = [
  {
    path: "/",
    redirect: "/caixiao365",
  },
  {
    path: "/caixiao365",
    component: () => import("@/views/caixiao365/index"),
  },

  {
    path: "/caixiaopingtai-21",
    component: () => import("@/views/caixiaopingtai/achievement-table-21"),
  },
  {
    path: "/caixiaopingtai-22",
    component: () => import("@/views/caixiaopingtai/"),
  },
  {
    path: "/516pingtai-11",
    component: () => import("@/views/516pingtai/achievement-table-11"),
  },
  {
    path: "/516pingtai-12",
    component: () => import("@/views/516pingtai/"),
  },
 
];
const router = new Router({
  mode: "hash",
  base: process.env.BASE_URL,
  scrollBehavior: () => ({ y: 0 }),
  routes,
});

// 重写路由的push方法，主要是为了解决同一个路由路径重复点击报错
const routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch((error) => error);
};
Vue.use(Router);
export default router;
