Add topic slug to route params
This commit is contained in:
parent
2e4255260b
commit
a7141c3ea0
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<nav class="top-navigation">
|
||||
<router-link to="/book/topic" active-class="top-navigation__link--active" class="top-navigation__link">Inhalte</router-link>
|
||||
<router-link to="/book/topic/geld-und-kauf" active-class="top-navigation__link--active" class="top-navigation__link">Inhalte</router-link>
|
||||
<router-link to="/rooms" active-class="top-navigation__link--active" class="top-navigation__link">Räume</router-link>
|
||||
<router-link to="/404" active-class="top-navigation__link--active" class="top-navigation__link">Portfolio</router-link>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
class="start-sections__section"
|
||||
title="Inhalte"
|
||||
subtitle="Lernen"
|
||||
route="/book/topic"
|
||||
route="/book/topic/geld-und-kauf"
|
||||
></section-block>
|
||||
<section-block
|
||||
class="start-sections__section"
|
||||
|
|
|
|||
|
|
@ -20,13 +20,15 @@
|
|||
},
|
||||
|
||||
apollo: {
|
||||
topic: {
|
||||
query: TOPIC_QUERY,
|
||||
variables: {
|
||||
slug: 'geld-und-kauf'
|
||||
},
|
||||
update(data) {
|
||||
return this.$getRidOfEdges(data).topic || {};
|
||||
topic() {
|
||||
return {
|
||||
query: TOPIC_QUERY,
|
||||
variables: {
|
||||
slug: this.$route.params.topicSlug
|
||||
},
|
||||
update(data) {
|
||||
return this.$getRidOfEdges(data).topic || {};
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ const routes = [
|
|||
name: 'book',
|
||||
component: book,
|
||||
children: [
|
||||
{path: 'topic', component: topic}
|
||||
{path: 'topic/:topicSlug', component: topic}
|
||||
]
|
||||
},
|
||||
{path: '*', component: p404}
|
||||
|
|
|
|||
Loading…
Reference in New Issue