🎨 Define data routes in router config

This commit is contained in:
2023-06-06 19:32:48 +02:00
parent d3bfb379c4
commit e416e599fa
2 changed files with 10 additions and 8 deletions

View File

@ -17,14 +17,7 @@ colorSchemeMedia.addEventListener(
);
const route = useRoute();
const routeName = computed(() => route.name);
const isDataView = computed(() => {
return (
routeName.value != "title.settings" &&
routeName.value != "title.login" &&
routeName.value != "title.token"
);
});
const isDataView = computed(() => route.meta.dataView || false);
</script>
<template>

View File

@ -19,16 +19,25 @@ const router = createRouter({
path: "/timetable",
name: "title.timetable",
component: TimetableView,
meta: {
dataView: true,
},
},
{
path: "/substitutions",
name: "title.substitutions",
component: SubstitutionView,
meta: {
dataView: true,
},
},
{
path: "/history",
name: "title.history",
component: HistoryView,
meta: {
dataView: true,
},
},
{
path: "/settings",