routing inside url
This commit is contained in:
parent
2d0fb30558
commit
6247c385c3
15 changed files with 278 additions and 203 deletions
|
@ -1,6 +1,8 @@
|
|||
<template>
|
||||
<div v-if="!defaultRoute && showBack" class="flex md:hidden flex-row items-baseline">
|
||||
<p v-if="!defaultRoute && showBack" class="text-primary" @click="setLink(null)">zur Übersicht</p>
|
||||
<RouterLink v-if="!defaultRoute && showBack" :to="{ name: `${rootRoute}-default` }" class="mid:hidden text-primary">
|
||||
zur Übersicht
|
||||
</RouterLink>
|
||||
</div>
|
||||
<slot v-if="headerInsert" name="headerInsert"></slot>
|
||||
<div
|
||||
|
@ -37,7 +39,10 @@ export default defineComponent({
|
|||
computed: {
|
||||
...mapState(useNavigationStore, ["activeLink"]),
|
||||
defaultRoute() {
|
||||
return this.activeLink == null;
|
||||
return ((this.$route?.name as string) ?? "").includes("-default");
|
||||
},
|
||||
rootRoute() {
|
||||
return ((this.$route?.name as string) ?? "").split("-")[0];
|
||||
},
|
||||
diffMain() {
|
||||
return this.$slots.diffMain;
|
||||
|
@ -49,8 +54,5 @@ export default defineComponent({
|
|||
return window.matchMedia("(min-width: 800px)").matches;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useNavigationStore, ["setLink"]),
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue