summaryrefslogtreecommitdiff
path: root/electron/src/renderer/router/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'electron/src/renderer/router/index.js')
-rw-r--r--electron/src/renderer/router/index.js44
1 files changed, 22 insertions, 22 deletions
diff --git a/electron/src/renderer/router/index.js b/electron/src/renderer/router/index.js
index 1200fa0e..e90a8fd5 100644
--- a/electron/src/renderer/router/index.js
+++ b/electron/src/renderer/router/index.js
@@ -5,32 +5,32 @@
* Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
*
*/
-
-import Vue from 'vue'
-import Router from 'vue-router'
-
-Vue.use(Router)
-
-export default new Router({
- routes: [
+import { createWebHashHistory, createRouter } from 'vue-router'
+const routes = [
{
- path: '/simulator',
- name: 'simulator',
- component: require('@/components/Simulator').default
+ path: '/simulator',
+ name: 'simulator',
+ component: () => import('../components/Simulator.vue')
},
{
- path: '/install',
- name: 'install',
- component: require('@/components/InstallPalettes').default
+ path: '/preferences',
+ name: 'preferences',
+ component: () => import('../components/Preferences.vue')
},
{
- path: '/preferences',
- name: 'preferences',
- component: require('@/components/Preferences').default
+ path: '/:pathMatch(.*)*',
+ name: 'NotFound',
+ component: () => import('../components/NotFound.vue')
},
- {
- path: '*',
- redirect: '/'
- }
- ]
+]
+const router = createRouter({
+ history: createWebHashHistory(),
+ routes
+})
+// Sets title for each routes
+const DEFAULT_TITLE = 'Ink/Stitch';
+
+router.beforeEach((to) => {
+ document.title = to.meta.title || DEFAULT_TITLE
})
+export default router