vehicle and base list items
This commit is contained in:
parent
3df3ba4ebc
commit
4ea0f9b5a1
9 changed files with 61 additions and 9 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue