I tried to use the Vue-router in my Vue project.
I installed it with npm install vue-router@latest
.
My problem right now is, that it isn`t working
My router.js file looks like this:
import Vue from 'vue';
import Router from 'vue-router';
import Home from './src/components/Home.vue'
Vue.use(Router);
export default new Router({
routes: [
{
path: '/',
name: 'Home',
component: Home
},
],
});
then I want to import it into the App.vue file with the <router-view></router-view>
tag, but here is the whole file:
<script setup>
import { RouterView } from 'vue-router';
</script>
<template>
<router-view></router-view>
</template>
Here is also a picture from the file structure:
Home.vue is just the whole landingpage, but when I run the server with npm run dev
, it just shows a white page. Does someone know what the problem here is?