Skip to content

Commit

Permalink
Insert 404 page inside of MainLayout
Browse files Browse the repository at this point in the history
Fix 404 error page styling

Fix unclickable links on 404 page issue
  • Loading branch information
smilingkylan committed Nov 5, 2023
1 parent e0d7f19 commit feaa8dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/pages/Error404.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
<script lang="ts">
import { DEFAULT_THEME } from 'src/config/BaseChain';
import { defineComponent } from 'vue';
export default defineComponent({
name: 'Error404Page',
setup () {
return {
secondary: DEFAULT_THEME.secondary,
};
},
});
</script>

<template>
<div class="fullscreen bg-blue text-white text-center q-pa-md flex flex-center">
<div>
<div class="text-primary text-center q-pa-md flex flex-center q-my-lg">
<div class="message-404">
<div class="text-xl">404</div>
<div class="text-h2">Oops. Nothing here...</div>
<q-btn
class="q-mt-xl"
color="white"
text-color="blue"
:text-color="secondary"
unelevated
to="/"
label="Go Home"
Expand All @@ -23,3 +29,8 @@ export default defineComponent({
</div>
</div>
</template>

<style lang="sass">
.message-404
color: var(--q-secondary)
</style>
3 changes: 2 additions & 1 deletion src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ const routes: RouteRecordRaw[] = [
// but you can also remove it
{
path: '/:catchAll(.*)*',
component: () => import('pages/Error404.vue'),
component: () => import('layouts/MainLayout.vue'),
children: [{ path: '', component: () => import('pages/Error404.vue') }],
},
];

Expand Down

0 comments on commit feaa8dd

Please sign in to comment.