Create Location component + tests

This commit is contained in:
2020-12-21 22:43:29 +01:00
parent cf9381309e
commit c3bb17f863
6 changed files with 472 additions and 8 deletions

View File

@@ -51,13 +51,16 @@
</ul>
</section>
<!-- <section
v-if="Object.keys(film.locations).length"
<section
class="p-4 lg:mr-4 bg-gray-100 rounded-md shadow-md transition-shadow duration-300 hover:shadow-xl"
>
<h3 class="font-medium text-lg">Locations</h3>
<div>{{ film.locations }}</div>
</section> -->
<ul v-if="locations.length">
<li :key="location.id" v-for="location in locations">
<Location :location="location" />
</li>
</ul>
</section>
</aside>
</div>
</template>
@@ -69,7 +72,8 @@ export default {
name: "Film",
components: {
Person: () => import("@/components/Person"),
Vehicle: () => import("@/components/Vehicle")
Vehicle: () => import("@/components/Vehicle"),
Location: () => import("@/components/Location")
},
head() {
return {
@@ -93,6 +97,11 @@ export default {
vehicles() {
return this.$store.getters["vehicles/getVehiclesByFilmId"](this.film.id);
},
locations() {
return this.$store.getters["locations/getLocationsByFilmId"](
this.film.id
);
},
...mapGetters({
film: "films/film"
})