diff options
author | pacien | 2022-09-03 01:34:26 +0200 |
---|---|---|
committer | pacien | 2022-09-03 01:34:26 +0200 |
commit | a8452594c6571e8003baa2aca14747eeeee08152 (patch) | |
tree | a894d99c22a601197869c7a6928d40bb4ae2c392 /viewer/src/plugins/router.ts | |
parent | dd9c9804e9e3da9880c711f53edb9c4a19d782f8 (diff) | |
parent | 00510820a2794efcadbc83f7f8b54318fe198ecb (diff) | |
download | ldgallery-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.ts | 22 |
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 | ||
20 | import Vue from "vue"; | 20 | import GalleryNavigation from '@/views/GalleryNavigation.vue'; |
21 | import VueRouter, { RouteConfig } from "vue-router"; | 21 | import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'; |
22 | import GalleryNavigation from "@/views/GalleryNavigation.vue"; | ||
23 | 22 | ||
24 | Vue.use(VueRouter); | 23 | const routes: Array<RouteRecordRaw> = [ |
25 | |||
26 | const 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 | ||
38 | const router = new VueRouter({ | 35 | export default createRouter({ |
36 | history: createWebHashHistory(), | ||
39 | routes, | 37 | routes, |
40 | }); | 38 | }); |
41 | |||
42 | export default router; | ||