generated from Seekra/repository-template
feat(settings): omit empty settings page segments
The composable useSettingsPage now omits empty segments in the path.
This commit is contained in:
@@ -18,12 +18,12 @@ import { useRouter } from 'vue-router';
|
||||
|
||||
export const normalizePagePath = function normalizePagePath (path) {
|
||||
return path
|
||||
.replace(/\.+/g, '.')
|
||||
.replace(/^\.+|\.+$/g, '')
|
||||
.split('.')
|
||||
.map(
|
||||
(segment) => segment.replace(/[^a-zA-Z0-9-]/g, '')
|
||||
);
|
||||
)
|
||||
.filter(Boolean);
|
||||
};
|
||||
|
||||
export const useSettingsPage = function useSettingsPage () {
|
||||
|
||||
Reference in New Issue
Block a user