Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

NotFound.tsx

38 lines1.0 KB

1import { Link } from '@tanstack/vue-router'
2import { defineComponent } from 'vue'
3​
4export const NotFound = defineComponent({
5 props: {
6 children: {
7 type: String,
8 default: undefined,
9 },
10 },
11 setup(props, { slots }) {
12 return () => (
13 <div class="space-y-2 p-2" data-testid="default-not-found-component">
14 <div class="text-gray-600 dark:text-gray-400">
15 {slots.default ? (
16 slots.default()
17 ) : (
18 <p>The page you are looking for does not exist.</p>
19 )}
20 </div>
21 <p class="flex items-center gap-2 flex-wrap">
22 <button
23 onClick={() => window.history.back()}
24 class="bg-emerald-500 text-white px-2 py-1 rounded-sm uppercase font-black text-sm"
25 >
26 Go back
27 </button>
28 <Link
29 to="/"
30 class="bg-cyan-600 text-white px-2 py-1 rounded-sm uppercase font-black text-sm"
31 >
32 Start Over
33 </Link>
34 </p>
35 </div>
36 )
37 },
38})