DEV Community 👩‍💻👨‍💻


Posted on

Vue3: setup router for NotFound page


1, Create your own "NotFound.vue" page

2, Add code to main.ts:

const routes = [
    path: "/",
    name: "home",
    component: Home,
  // ... other paths ...
    path: "/:pathMatch(.*)*",
    name: "not-found",
    component: () => import("@/pages/NotFound.vue"),
Enter fullscreen mode Exit fullscreen mode

3, Config Nginx:

location / {
    try_files $uri $uri/ /index.html;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Timeless DEV post...

How to write a kickass README

Arguably the single most important piece of documentation for any open source project is the README. A good README not only informs people what the project does and who it is for but also how they use and contribute to it.

If you write a README without sufficient explanation of what your project does or how people can use it then it pretty much defeats the purpose of being open source as other developers are less likely to engage with or contribute towards it.