import { createRouter, createWebHashHistory } from "vue-router";

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      name: "home",
      component: () => import("../home"),
    },
    {
      path: "/detail/:id",
      name: "detail",
      component: () => import("../detail"),
    },
    {
      path: "/article/:id",
      name: "article",
      component: () => import("../detail/article"),
    },
    {
      path: "/404",
      name: "404",
      component: () => import("../../404"),
    },
  ],
  scrollBehavior() {
    return { left: 0, top: 0 };
  },
});

export default router;
