aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/plugins/router.ts
diff options
context:
space:
mode:
authorpacien2022-09-03 01:34:26 +0200
committerpacien2022-09-03 01:34:26 +0200
commita8452594c6571e8003baa2aca14747eeeee08152 (patch)
treea894d99c22a601197869c7a6928d40bb4ae2c392 /viewer/src/plugins/router.ts
parentdd9c9804e9e3da9880c711f53edb9c4a19d782f8 (diff)
parent00510820a2794efcadbc83f7f8b54318fe198ecb (diff)
downloadldgallery-a8452594c6571e8003baa2aca14747eeeee08152.tar.gz
Merge branch 'vue3-refactoring-staging' into develop
Reviewed-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'viewer/src/plugins/router.ts')
-rw-r--r--viewer/src/plugins/router.ts22
1 files changed, 9 insertions, 13 deletions
diff --git a/viewer/src/plugins/router.ts b/viewer/src/plugins/router.ts
index 03ca021..8568173 100644
--- a/viewer/src/plugins/router.ts
+++ b/viewer/src/plugins/router.ts
@@ -1,7 +1,7 @@
1/* ldgallery - A static generator which turns a collection of tagged 1/* ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery. 2-- pictures into a searchable web gallery.
3-- 3--
4-- Copyright (C) 2019-2020 Guillaume FOUET 4-- Copyright (C) 2019-2022 Guillaume FOUET
5-- 5--
6-- This program is free software: you can redistribute it and/or modify 6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as 7-- it under the terms of the GNU Affero General Public License as
@@ -17,26 +17,22 @@
17-- along with this program. If not, see <https://www.gnu.org/licenses/>. 17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/ 18*/
19 19
20import Vue from "vue"; 20import GalleryNavigation from '@/views/GalleryNavigation.vue';
21import VueRouter, { RouteConfig } from "vue-router"; 21import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
22import GalleryNavigation from "@/views/GalleryNavigation.vue";
23 22
24Vue.use(VueRouter); 23const routes: Array<RouteRecordRaw> = [
25
26const routes: RouteConfig[] = [
27 { 24 {
28 path: "*", 25 path: '/:catchAll(.*)',
29 name: "GalleryNavigation", 26 name: 'GalleryNavigation',
30 component: GalleryNavigation, 27 component: GalleryNavigation,
31 props: route => ({ 28 props: route => ({
32 path: route.params.pathMatch, 29 path: decodeURIComponent(route.path),
33 query: Object.keys(route.query), 30 query: Object.keys(route.query),
34 }), 31 }),
35 }, 32 },
36]; 33];
37 34
38const router = new VueRouter({ 35export default createRouter({
36 history: createWebHashHistory(),
39 routes, 37 routes,
40}); 38});
41
42export default router;