From 6d13000ab8a5cd5207487c21b0db68c0d82af50c Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Wed, 4 Dec 2024 15:09:20 -0300 Subject: [PATCH] ping-viewer-next-frontend: Add route for addons/widget/[type] --- .../src/pages/addons/widget/[type]/index.vue | 277 ++++++++++++++++++ .../src/pages/addons/widget/index.vue | 104 +++++++ ping-viewer-next-frontend/src/router/index.js | 14 + 3 files changed, 395 insertions(+) create mode 100644 ping-viewer-next-frontend/src/pages/addons/widget/[type]/index.vue create mode 100644 ping-viewer-next-frontend/src/pages/addons/widget/index.vue diff --git a/ping-viewer-next-frontend/src/pages/addons/widget/[type]/index.vue b/ping-viewer-next-frontend/src/pages/addons/widget/[type]/index.vue new file mode 100644 index 00000000..369c90fd --- /dev/null +++ b/ping-viewer-next-frontend/src/pages/addons/widget/[type]/index.vue @@ -0,0 +1,277 @@ + + + + + diff --git a/ping-viewer-next-frontend/src/pages/addons/widget/index.vue b/ping-viewer-next-frontend/src/pages/addons/widget/index.vue new file mode 100644 index 00000000..e6091ca2 --- /dev/null +++ b/ping-viewer-next-frontend/src/pages/addons/widget/index.vue @@ -0,0 +1,104 @@ + + + diff --git a/ping-viewer-next-frontend/src/router/index.js b/ping-viewer-next-frontend/src/router/index.js index a66c542f..ef172257 100644 --- a/ping-viewer-next-frontend/src/router/index.js +++ b/ping-viewer-next-frontend/src/router/index.js @@ -12,6 +12,20 @@ import { routes } from 'vue-router/auto-routes'; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: setupLayouts(routes), + strict: false, +}); + +router.beforeEach((to, from, next) => { + if (!to.path.endsWith('/') && to.path.length > 1) { + const { hash, params, query } = to; + return next({ + path: `${to.path}/`, + hash, + params, + query, + }); + } + next(); }); // Workaround for https://github.com/vitejs/vite/issues/11804