From cd4956fbe67cf9c9a1464209e12cc5237ee1e89e Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Sun, 26 Jul 2026 19:28:00 +0200 Subject: [PATCH] refactor(settings): push route object instead of raw string Modified the useSettingsPage composable to use a route object instead of a raw string in goToSettingsPage and moved settings route child routes into the settings route itself using 'rest(.*)*'. --- src/features/settings/composables/useSettingsPage.js | 9 +++++++-- src/router/index.js | 8 +------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/features/settings/composables/useSettingsPage.js b/src/features/settings/composables/useSettingsPage.js index e66d73f..31f387a 100644 --- a/src/features/settings/composables/useSettingsPage.js +++ b/src/features/settings/composables/useSettingsPage.js @@ -20,14 +20,19 @@ const normalizePagePath = function normalizePagePath (path) { return path .replace(/\.+/g, '.') .replace(/^\.+|\.+$/g, '') - .replace(/\./g, '/'); + .split('.'); }; export const useSettingsPage = function useSettingsPage () { const router = useRouter(); const goToSettingsPage = function goToSettingsPage (pagePath) { - return router.push(`/settings/${normalizePagePath(pagePath)}`); + return router.push({ + name: 'settings', + params: { + rest: normalizePagePath(pagePath) + } + }); }; return { goToSettingsPage }; diff --git a/src/router/index.js b/src/router/index.js index 5010acc..c622980 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -40,15 +40,9 @@ const routes = [ } }, { - path: '/settings', + path: '/settings/:rest(.*)*', name: 'settings', component: SettingsView, - children: [ - { - path: ':rest(.*)', - component: SettingsView - } - ], meta: { title: () => i18n.global.t('preferences.settings') }