Skip to content
Snippets Groups Projects
Commit 03085a78 authored by Håkon Eilertsen Røskaft's avatar Håkon Eilertsen Røskaft
Browse files

Merge branch '404-page' into 'main'

add path not found page

See merge request !108
parents b45c5fe8 19ea65e6
No related branches found
No related tags found
1 merge request!108add path not found page
Pipeline #180846 failed
import store from "@/store";
import { createRouter, createWebHistory } from "vue-router";
import NotFound from "@/views/NotFound.vue";
/**
* Guards routes. If token is null, no user is logged in and only the
......@@ -133,6 +134,8 @@ const routes = [
name: "UserItems",
component: () => import("../views/UserProfileViews/UserItemsView.vue"),
},
// Make sure it's your last route definition
{ path: "/:pathMatch(.*)*", name: "not-found", component: NotFound },
];
const router = createRouter({
......@@ -140,4 +143,9 @@ const router = createRouter({
routes,
});
router.resolve({
name: "not-found",
params: { pathMatch: ["not", "found"] },
}).href;
export default router;
<template>
<div class="flex place-content-center h-full p-8">
<div class="bg-gray-300 p-8 rounded-2xl drop-shadow-xl">
<h1 class="text-primary-medium text-4xl">Oisann!</h1>
<p>Her skjedde det visst en feil...</p>
<p>
Lyst å gå tilbake til
<router-link to="/" class="underline">start?</router-link>
</p>
</div>
</div>
</template>
<script>
export default {};
</script>
<style></style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment