Configured Vue Router

This commit is contained in:
2023-06-14 10:03:43 +02:00
parent 70350b8d88
commit cb00ae291a
6 changed files with 39 additions and 18 deletions

View File

@@ -13,7 +13,7 @@ onMounted(() => {
</script>
<template>
<XmlTool></XmlTool>
<RouterView></RouterView>
</template>
<style scoped></style>

View File

@@ -1,5 +1,4 @@
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue';
</script>

View File

@@ -1,4 +1,5 @@
import { createApp } from 'vue'
import App from './App.vue'
import { createApp } from 'vue';
import router from "./router";
import App from './App.vue';
createApp(App).mount('#app')
createApp(App).use(router).mount('#app')

View File

@@ -1,21 +1,20 @@
import { createRouter, createWebHistory } from 'vue-router'
import XmlTool from '../components/XmlTool.vue';
const landingPage = import("@/views/LandingView.vue")
const routes = [
{
path: '/',
name: 'landing',
component: () => landingPage
},
]
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'landing',
component: () => import('../components/XmlTool.vue')
},
{
path: '/xmltools',
name: 'portfolio',
component: () => import('../views/PortfolioView.vue')
}
]
routes: routes
})
export default router;

View File

@@ -0,0 +1,14 @@
<script lang="ts">
import LandingComponent from '@/components/LandingComponent.vue'
export default {
name:"LandingView",
components: {LandingComponent}
}
</script>
<template>
<LandingComponent></LandingComponent>
</template>

View File

@@ -1,4 +1,12 @@
{
"extends": "@vue/tsconfig/tsconfig.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"files": [],
"references": [
{