summaryrefslogtreecommitdiff
path: root/electron/src/renderer/router
diff options
context:
space:
mode:
authorrejbasket <39080670+rejbasket@users.noreply.github.com>2023-05-22 22:33:19 +0200
committerGitHub <noreply@github.com>2023-05-22 22:33:19 +0200
commitef6f6580df6e8fbce913eecc1fe7e0f8caf1315b (patch)
treec1119a5d1affd44ad27e60cc6981ac98534c518d /electron/src/renderer/router
parentda54f104e6bf5d0e98f7479cf1d060c76e0b01f2 (diff)
Update electron version to v14.2.9 (#2214)
Authored-by: rejbasket Co-authored-by: Kaalleen Co-authored-by: Lex Neva
Diffstat (limited to 'electron/src/renderer/router')
-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