@@ -44,18 +44,19 @@ const { t } = useI18n();
|
|||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const menuItems = [
|
const menuItems = computed(() => [
|
||||||
{ id: 'general', name: t('pages.admin.general') },
|
{ id: 'general', name: t('pages.admin.general') },
|
||||||
{ id: 'config', name: t('pages.admin.config') },
|
{ id: 'config', name: t('pages.admin.config') },
|
||||||
{ id: 'interface', name: t('pages.admin.interface') },
|
{ id: 'interface', name: t('pages.admin.interface') },
|
||||||
{ id: 'hooks', name: t('pages.admin.hooks') },
|
{ id: 'hooks', name: t('pages.admin.hooks') },
|
||||||
];
|
]);
|
||||||
|
|
||||||
const defaultItem = { id: '', name: t('pages.admin.panel') };
|
const defaultItem = { id: '', name: t('pages.admin.panel') };
|
||||||
|
|
||||||
const activeMenuItem = computed(() => {
|
const activeMenuItem = computed(() => {
|
||||||
return (
|
return (
|
||||||
menuItems.find((item) => route.path === `/admin/${item.id}`) ?? defaultItem
|
menuItems.value.find((item) => route.path === `/admin/${item.id}`) ??
|
||||||
|
defaultItem
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user