aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/main.ts
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-10-20 22:30:49 +0200
committerGitHub <noreply@github.com>2022-10-20 22:30:49 +0200
commit31f26c4dd4a92bb5826ad2af9ccb9808fca40e40 (patch)
tree6ec4bfbca57658543e0cf6d610af1c21f2de106c /src-vue/src/main.ts
parent9b4e032b73e3f40c8c4126a25356f467a833d239 (diff)
parent2e5c9b034d6bd7aa6fddc7f7f75be071b30b9c5a (diff)
downloadFlightCore-31f26c4dd4a92bb5826ad2af9ccb9808fca40e40.tar.gz
FlightCore-31f26c4dd4a92bb5826ad2af9ccb9808fca40e40.zip
Merge pull request #25 from Alystrasz/refactor/router-view
refactor: Router view
Diffstat (limited to 'src-vue/src/main.ts')
-rw-r--r--src-vue/src/main.ts26
1 files changed, 24 insertions, 2 deletions
diff --git a/src-vue/src/main.ts b/src-vue/src/main.ts
index 0ac31a2d..dc18b443 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: async () => PlayView},
+ { path: '/changelog', name: 'Changelog', component: async () => ChangelogView},
+ { path: '/settings', name: 'Settings', component: async () => SettingsView},
+ { path: '/dev', name: 'Dev', component: async () => DeveloperView}
+];
+export const router = createRouter({
+ history: createWebHashHistory(),
+ routes, // short for `routes: routes`
+});
+app.use(router);
+
+
app.mount('#app')