feat(page): added 404 page
This commit is contained in:
		
							parent
							
								
									655019cf23
								
							
						
					
					
						commit
						3db4f91c27
					
				
							
								
								
									
										32
									
								
								src/pages/404.page.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								src/pages/404.page.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | |||||||
|  | <script setup lang="ts"> | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <template> | ||||||
|  |     <div class="e404-wrapper"> | ||||||
|  |         <n-result | ||||||
|  |             status="404" | ||||||
|  |             title="404 Not Found" | ||||||
|  |             description="Sorry, this page does not seem to extist" | ||||||
|  |         > | ||||||
|  |             <template #footer> | ||||||
|  |                 <router-link to="/" #="{ navigate, href }" custom> | ||||||
|  |                     <n-button | ||||||
|  |                         tag="a" | ||||||
|  |                         :href="href" | ||||||
|  |                         secondary | ||||||
|  |                         @click="navigate" | ||||||
|  |                         type="success" | ||||||
|  |                     >Back home</n-button> | ||||||
|  |                 </router-link> | ||||||
|  |             </template> | ||||||
|  |         </n-result> | ||||||
|  |     </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | <style scoped> | ||||||
|  | .e404-wrapper { | ||||||
|  |     padding-top: 150px; | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @ -38,9 +38,11 @@ import { | |||||||
|   NMenu, |   NMenu, | ||||||
|   NMessageProvider, |   NMessageProvider, | ||||||
|   NPageHeader, |   NPageHeader, | ||||||
|  |   NResult, | ||||||
| } from 'naive-ui'; | } from 'naive-ui'; | ||||||
| 
 | 
 | ||||||
| const components = [ | const components = [ | ||||||
|  |   NResult, | ||||||
|   NPageHeader, |   NPageHeader, | ||||||
|   NMessageProvider, |   NMessageProvider, | ||||||
|   NLayout, |   NLayout, | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| import { layouts } from './layouts/index'; | import { layouts } from './layouts/index'; | ||||||
| import { createRouter, createWebHistory } from 'vue-router'; | import { createRouter, createWebHistory } from 'vue-router'; | ||||||
| import HomePage from './pages/Home.page.vue'; | import HomePage from './pages/Home.page.vue'; | ||||||
|  | import NotFound from './pages/404.page.vue'; | ||||||
| import { tools } from './tools'; | import { tools } from './tools'; | ||||||
| 
 | 
 | ||||||
| const router = createRouter({ | const router = createRouter({ | ||||||
| @ -12,6 +13,7 @@ const router = createRouter({ | |||||||
|       component: HomePage, |       component: HomePage, | ||||||
|     }, |     }, | ||||||
|     ...tools.map(({ path, name, component, ...config }) => ({ path, name, component, meta: { isTool: true, layout: layouts.toolLayout, name, ...config } })), |     ...tools.map(({ path, name, component, ...config }) => ({ path, name, component, meta: { isTool: true, layout: layouts.toolLayout, name, ...config } })), | ||||||
|  |     { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound }, | ||||||
|   ], |   ], | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user