generated from Seekra/repository-template
Feat(settings): add renderer for settings configuration #142
@@ -20,14 +20,19 @@ const normalizePagePath = function normalizePagePath (path) {
|
|||||||
return path
|
return path
|
||||||
.replace(/\.+/g, '.')
|
.replace(/\.+/g, '.')
|
||||||
.replace(/^\.+|\.+$/g, '')
|
.replace(/^\.+|\.+$/g, '')
|
||||||
.replace(/\./g, '/');
|
.split('.');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useSettingsPage = function useSettingsPage () {
|
export const useSettingsPage = function useSettingsPage () {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const goToSettingsPage = function goToSettingsPage (pagePath) {
|
const goToSettingsPage = function goToSettingsPage (pagePath) {
|
||||||
return router.push(`/settings/${normalizePagePath(pagePath)}`);
|
return router.push({
|
||||||
|
name: 'settings',
|
||||||
|
params: {
|
||||||
|
rest: normalizePagePath(pagePath)
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return { goToSettingsPage };
|
return { goToSettingsPage };
|
||||||
|
|||||||
+1
-7
@@ -40,15 +40,9 @@ const routes = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/settings',
|
path: '/settings/:rest(.*)*',
|
||||||
name: 'settings',
|
name: 'settings',
|
||||||
component: SettingsView,
|
component: SettingsView,
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: ':rest(.*)',
|
|
||||||
component: SettingsView
|
|
||||||
}
|
|
||||||
],
|
|
||||||
meta: {
|
meta: {
|
||||||
title: () => i18n.global.t('preferences.settings')
|
title: () => i18n.global.t('preferences.settings')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user