Page: Add component to show block for pages by category - refs BT#20919

pull/5156/head
Angel Fernando Quiroz Campos 10 months ago
parent 2e26259eb4
commit 87add342ec
  1. 38
      assets/vue/components/page/PageList.vue

@ -0,0 +1,38 @@
<script setup>
import { ref } from "vue"
import { useI18n } from "vue-i18n"
import PageCard from "./PageCard.vue"
import pageService from "../../services/page"
const props = defineProps({
categoryTitle: {
type: String,
required: true,
},
})
const { locale } = useI18n()
const pageList = ref([])
pageService
.findAll({
params : {
"category.title": props.categoryTitle,
enabled: "1",
locale: locale.value,
},
})
.then(response => response.json())
.then(json => pageList.value = json["hydra:member"])
</script>
<template>
<div class="mt-auto">
<PageCard
v-for="page in pageList"
:key="page.id"
:page="page"
/>
</div>
</template>
Loading…
Cancel
Save