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(.*)*'.
This commit is contained in:
2026-07-28 20:10:20 +02:00
parent 241ac889fc
commit cd4956fbe6
2 changed files with 8 additions and 9 deletions
@@ -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 };