mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
feat: use vue router to organize pages
This commit is contained in:
1 parent
a230f38393
commit
c3b7968a76
8 files changed
+110
-68
No files matched your search
+21
-1
@@ -1,4 +1,5 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import './style.css'
|
||||
|
||||
/* import the fontawesome core */
|
||||
@@ -24,7 +25,10 @@ import {
|
||||
faCircleQuestion,
|
||||
faCircleRight,
|
||||
} from '@fortawesome/free-regular-svg-icons'
|
||||
|
||||
import App from './App.vue'
|
||||
import GamePage from './views/GamePage.vue'
|
||||
import AuthPage from './views/AuthPage.vue'
|
||||
|
||||
/* add icons to the library */
|
||||
library.add(
|
||||
@@ -41,4 +45,20 @@ library.add(
|
||||
faTerminal
|
||||
)
|
||||
|
||||
createApp(App).component('font-awesome-icon', FontAwesomeIcon).mount('#app')
|
||||
const routes = [
|
||||
{ path: '/', name: 'Home', component: AuthPage },
|
||||
{ path: '/game', name: 'Game', component: GamePage },
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes,
|
||||
})
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.component('font-awesome-icon', FontAwesomeIcon)
|
||||
|
||||
app.use(router)
|
||||
|
||||
app.mount('#app')
|
||||
Reference in new issue
Block a user