From ef6f6580df6e8fbce913eecc1fe7e0f8caf1315b Mon Sep 17 00:00:00 2001 From: rejbasket <39080670+rejbasket@users.noreply.github.com> Date: Mon, 22 May 2023 22:33:19 +0200 Subject: Update electron version to v14.2.9 (#2214) Authored-by: rejbasket Co-authored-by: Kaalleen Co-authored-by: Lex Neva --- electron/src/renderer/router/index.js | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'electron/src/renderer/router') 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 -- cgit v1.2.3