vehicle and base list items

This commit is contained in:
Julian Krauser 2024-11-03 15:34:48 +01:00
parent 3df3ba4ebc
commit 4ea0f9b5a1
9 changed files with 61 additions and 9 deletions

View file

@ -1,12 +1,27 @@
<template>
<p>{{ data }}</p>
<div v-for="item in collection" :key="item.slug" class="contents">
<BaseListImageItem v-if="data?.lookup.imageItem" :data="item" />
<BaseListItem v-else :data="item" />
</div>
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type SharedList from "../../types/component/sharedList";
import type BaseCollection from "~/types/collection/baseCollection";
defineProps({
const { find } = useStrapi();
const props = defineProps({
data: Object as PropType<SharedList>,
});
const { data: collections } = await useAsyncData("collection", () =>
find<BaseCollection>(props.data?.lookup.collection ?? "", {
populate: {
populate: "*",
},
})
);
const collection = ref<Array<BaseCollection> | undefined>(collections.value?.data);
</script>