Fix problem with reactive property and use computed to get the length of the rooms
This commit is contained in:
parent
8fc0b07eb1
commit
a68122f3e7
|
|
@ -41,7 +41,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="room__meta">
|
<div class="room__meta">
|
||||||
<room-group-widget :group="'Fábrica Nacional de Moneda y Timbre'"></room-group-widget>
|
<room-group-widget :group="'Fábrica Nacional de Moneda y Timbre'"></room-group-widget>
|
||||||
|
|
||||||
<room-entry-count-widget :entry-count="room.roomEntries.length"></room-entry-count-widget>
|
<room-entry-count-widget :entry-count="roomEntryCount"></room-entry-count-widget>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="room__content">
|
<div class="room__content">
|
||||||
|
|
@ -47,27 +47,33 @@
|
||||||
this.$store.dispatch('setSpecialContainerClass', 'red');
|
this.$store.dispatch('setSpecialContainerClass', 'red');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
room: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
roomEntryCount() {
|
||||||
|
return (this.room && this.room.roomEntries) ? this.room.roomEntries.length : 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
apollo: {
|
apollo: {
|
||||||
modules: {
|
modules: {
|
||||||
query: ROOM_ENTRIES_QUERY,
|
query: ROOM_ENTRIES_QUERY,
|
||||||
variables: {
|
variables() {
|
||||||
slug: this.slug
|
return {
|
||||||
// slug: "ein-historisches-festival"
|
slug: this.slug
|
||||||
|
}
|
||||||
},
|
},
|
||||||
manual: true,
|
manual: true,
|
||||||
result({data, loading, networkStatus}) {
|
result({data, loading, networkStatus}) {
|
||||||
if (!loading) {
|
if (!loading) {
|
||||||
debugger
|
|
||||||
this.room = this.$getRidOfEdges(data).room
|
this.room = this.$getRidOfEdges(data).room
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
room: []
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// data() {
|
// data() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue