Add basic routing and layout structure

Replaced App.vue with Layout.vue to serve as the main layout. Added Home and 404NotFound route components and configured router to handle home and fallback routes. Updated main.ts to use the new layout component.
This commit is contained in:
2025-10-04 16:43:09 +02:00
parent 9ccfd2e526
commit 74cfa283a1
6 changed files with 49 additions and 13 deletions

View File

@@ -1,11 +0,0 @@
<script setup lang="ts"></script>
<template>
<h1>You did it!</h1>
<p>
Visit <a href="https://vuejs.org/" target="_blank" rel="noopener">vuejs.org</a> to read the
documentation
</p>
</template>
<style scoped></style>

8
GUI/src/Layout.vue Normal file
View File

@@ -0,0 +1,8 @@
<script setup lang="ts"></script>
<template>
<h1>You did it!</h1>
<router-view></router-view>
</template>
<style scoped></style>

View File

@@ -1,5 +1,5 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './Layout.vue'
import router from './router' import router from './router'
import vuetify from './plugins/vuetify' import vuetify from './plugins/vuetify'

View File

@@ -1,8 +1,17 @@
import Home from '@/routes/Home.vue'
import NotFound from '@/routes/404NotFound.vue'
import { createRouter, createWebHistory } from 'vue-router' import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
routes: [], routes: [
{
name: 'Home',
path: '/',
component: Home,
},
{ path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
],
}) })
export default router export default router

View File

@@ -0,0 +1,21 @@
<script setup lang="ts"></script>
<template>
<h1>404</h1>
</template>
<style scoped>
.error-title {
font-size: 3rem;
font-weight: bold;
margin-bottom: 1rem;
letter-spacing: 2px;
color: #fff;
}
.error-message {
font-size: 1.25rem;
opacity: 0.85;
color: #fff;
}
</style>

9
GUI/src/routes/Home.vue Normal file
View File

@@ -0,0 +1,9 @@
<script setup lang="ts">
</script>
<template>
<h1>Home Vue</h1>
</template>
<style scoped>
</style>