create router setup
import router in main.ts
This commit is contained in:
parent
9894c467a6
commit
0c6844cbef
2 changed files with 31 additions and 1 deletions
|
|
@ -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
27
src/router/index.ts
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue