Add router setup

This commit is contained in:
2025-09-23 16:14:17 +02:00
parent a738d2e192
commit c1a86e9ae0
4 changed files with 40 additions and 1 deletions

View File

@@ -6,7 +6,12 @@
Visit <a href="https://vuejs.org/" target="_blank" rel="noopener">vuejs.org</a> to read the
documentation
</p>
<nav>
<Button><RouterLink to="/">Go to Home</RouterLink></button>
<Button><RouterLink to="/test">Go to Test</RouterLink></button>
</nav>
<Button>Button</Button>
<RouterView />
</template>
<style scoped></style>

View File

@@ -1,8 +1,14 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import TestView from '../views/TestView.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [],
routes: [
{ path: '/', component: HomeView },
{ path: '/test', component: TestView },
],
})
export default router

16
src/views/HomeView.vue Normal file
View File

@@ -0,0 +1,16 @@
<script lang="ts">
export default {
name: "HomeView"
};
</script>
<template>
<h1>Home View</h1>
<p>
Visit <a href="https://vuejs.org/" target="_blank" rel="noopener">vuejs.org</a> to read the
documentation
</p>
<Button>Button</Button>
</template>
<style scoped></style>

12
src/views/TestView.vue Normal file
View File

@@ -0,0 +1,12 @@
<script lang="ts">
export default {
name: "TestView"
};
</script>
<template>
<h1>Test Page</h1>
<Button>Test Button</Button>
</template>
<style scoped></style>