create router setup

import router in main.ts
This commit is contained in:
padreug 2025-02-02 17:17:41 +01:00
parent 9894c467a6
commit 0c6844cbef
2 changed files with 31 additions and 1 deletions

View file

@ -1,5 +1,8 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import './assets/index.css'
createApp(App).mount('#app')
const app = createApp(App)
app.use(router)
app.mount('#app')

27
src/router/index.ts Normal file
View file

@ -0,0 +1,27 @@
import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/pages/Home.vue'
import Directory from '@/pages/Directory.vue'
import FAQ from '@/pages/FAQ.vue'
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
name: 'home',
component: Home
},
{
path: '/directory',
name: 'directory',
component: Directory
},
{
path: '/faq',
name: 'faq',
component: FAQ
}
]
})
export default router