diff options
author | Remy Raes <raes.remy@gmail.com> | 2022-10-20 00:55:09 +0200 |
---|---|---|
committer | Remy Raes <raes.remy@gmail.com> | 2022-10-20 00:55:09 +0200 |
commit | 5bcd8063ee1dbf0df5af6b4e19e7498ba69d3e58 (patch) | |
tree | 7b85cc20780aea548bd56f92a60960abe38d3b13 /src-vue | |
parent | a4e2e5e75c9301ffb5ab9f31c1a6d43106f33db6 (diff) | |
download | FlightCore-5bcd8063ee1dbf0df5af6b4e19e7498ba69d3e58.tar.gz FlightCore-5bcd8063ee1dbf0df5af6b4e19e7498ba69d3e58.zip |
feat: add router config
Diffstat (limited to 'src-vue')
-rw-r--r-- | src-vue/src/main.ts | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src-vue/src/main.ts b/src-vue/src/main.ts index 0ac31a2d..623b175d 100644 --- a/src-vue/src/main.ts +++ b/src-vue/src/main.ts @@ -2,14 +2,21 @@ import { createApp } from 'vue' import App from './App.vue' import ElementPlus from "element-plus"; import * as ElementPlusIconsVue from '@element-plus/icons-vue' +import { store } from './plugins/store'; +import PlayView from "./views/PlayView.vue"; +import ChangelogView from "./views/ChangelogView.vue"; +import SettingsView from "./views/SettingsView.vue"; +import DeveloperView from "./views/DeveloperView.vue"; +import {createRouter, createWebHashHistory} from "vue-router"; + + +const app = createApp(App); // styles import 'element-plus/theme-chalk/index.css'; import './style.css' -import { store } from './plugins/store'; -const app = createApp(App); app.use(ElementPlus); // icons @@ -20,4 +27,19 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) { // style app.use( store, '$store' ); + +// routes +const routes = [ + { path: '/', name: 'Main', component: () => PlayView}, + { path: '/changelog', name: 'Changelog', component: () => ChangelogView}, + { path: '/settings', name: 'Settings', component: () => SettingsView}, + { path: '/dev', name: 'Dev', component: () => DeveloperView} +]; +const router = createRouter({ + history: createWebHashHistory(), + routes, // short for `routes: routes` +}); +app.use(router); + + app.mount('#app') |