diff options
-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') |