fix(frontend): Menubalk niet tonen voor niet-aangemeldde gebruikers
Dit lost de fout op.
This commit is contained in:
		
							parent
							
								
									25cacb048b
								
							
						
					
					
						commit
						d29e2af31f
					
				
					 4 changed files with 497 additions and 238 deletions
				
			
		|  | @ -1,10 +1,29 @@ | |||
| <script setup lang="ts"> | ||||
|     import auth from "@/services/auth/auth-service.ts"; | ||||
|     import MenuBar from "@/components/MenuBar.vue"; | ||||
|     import {useRoute} from "vue-router"; | ||||
|     import {computed} from "vue"; | ||||
| 
 | ||||
|     const route = useRoute(); | ||||
|     auth.loadUser(); | ||||
| 
 | ||||
|     interface RouteMeta { | ||||
|         requiresAuth?: boolean; | ||||
|     } | ||||
| 
 | ||||
|     const showMenuBar = computed(() => | ||||
|         (route.meta as RouteMeta).requiresAuth in [false, undefined] | ||||
|         && auth.authState.user | ||||
|     ) | ||||
| </script> | ||||
| 
 | ||||
| <template> | ||||
|     <router-view /> | ||||
|     <v-app> | ||||
|         <menu-bar v-if="showMenuBar"></menu-bar> | ||||
|         <v-main> | ||||
|             <router-view /> | ||||
|         </v-main> | ||||
|     </v-app> | ||||
| </template> | ||||
| 
 | ||||
| <style scoped></style> | ||||
|  |  | |||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger