🎨 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 route = useRoute();
const routeName = computed(() => route.name); const isDataView = computed(() => route.meta.dataView || false);
const isDataView = computed(() => {
return (
routeName.value != "title.settings" &&
routeName.value != "title.login" &&
routeName.value != "title.token"
);
});
</script> </script>
<template> <template>

View File

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