route v1
This commit is contained in:
		
							
								
								
									
										16
									
								
								app/router.options.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								app/router.options.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| import type { RouterScrollBehavior } from 'vue-router' | ||||
|  | ||||
| const scrollBehavior: RouterScrollBehavior = (to, from, savedPosition) => { | ||||
|   if (savedPosition) { | ||||
|     return savedPosition | ||||
|   } | ||||
|   if (to.hash) { | ||||
|     return { el: to.hash } | ||||
|   } | ||||
|   // Preserve current scroll position on navigation (no scroll-to-top) | ||||
|   return false | ||||
| } | ||||
|  | ||||
| export default { | ||||
|   scrollBehavior | ||||
| } | ||||
		Reference in New Issue
	
	Block a user