Add instrument query to instrument overview
This commit is contained in:
parent
2a4cf56825
commit
cd6ff31cef
|
|
@ -0,0 +1,12 @@
|
||||||
|
query InstrumentQuery($type: String!){
|
||||||
|
instruments(type: $type) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
contents
|
||||||
|
slug
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,19 +6,44 @@
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="instrument-overview__list">
|
<div class="instrument-overview__list">
|
||||||
<instrument-teaser></instrument-teaser>
|
<instrument-teaser
|
||||||
<instrument-teaser></instrument-teaser>
|
:title="instrument.title"
|
||||||
<instrument-teaser></instrument-teaser>
|
:contents="instrument.contents"
|
||||||
|
v-for="instrument in instruments"
|
||||||
|
:key="instrument.id"
|
||||||
|
></instrument-teaser>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import InstrumentTeaser from '@/components/InstrumentTeaser';
|
import InstrumentTeaser from '@/components/InstrumentTeaser';
|
||||||
|
import INSTRUMENTS_QUERY from '@/graphql/gql/instrumentsByTypeQuery.gql';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
InstrumentTeaser
|
InstrumentTeaser
|
||||||
|
},
|
||||||
|
|
||||||
|
apollo: {
|
||||||
|
instruments: {
|
||||||
|
query: INSTRUMENTS_QUERY,
|
||||||
|
variables: {
|
||||||
|
type: 'society'
|
||||||
|
},
|
||||||
|
manual: true,
|
||||||
|
result({data, loading, networkStatus}) {
|
||||||
|
if (!loading) {
|
||||||
|
this.instruments = this.$getRidOfEdges(data).instruments;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
instruments: []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -49,6 +74,7 @@
|
||||||
&__list {
|
&__list {
|
||||||
padding: $large-spacing 0;
|
padding: $large-spacing 0;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
|
width: 100%;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
grid-auto-rows: auto;
|
grid-auto-rows: auto;
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ const routes = [
|
||||||
{path: '/room/:slug', name: 'room', component: room, props: true},
|
{path: '/room/:slug', name: 'room', component: room, props: true},
|
||||||
{path: '/article/:slug', name: 'article', component: article, meta: {layout: 'simple'}},
|
{path: '/article/:slug', name: 'article', component: article, meta: {layout: 'simple'}},
|
||||||
{
|
{
|
||||||
path: '/instrument/',
|
path: '/instruments/:slug',
|
||||||
name: 'instrument-overview',
|
name: 'instrument-overview',
|
||||||
component: instrumentOverview,
|
component: instrumentOverview,
|
||||||
meta: {subnavigation: true}
|
meta: {subnavigation: true}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue