Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/assets/vue/components/page/PageCardList.vue

45 lines
812 B

<template>
<div
v-if="pageList.length"
>
<PageCard
v-for="page in pageList"
:key="page.id"
:page="page"
/>
</div>
</template>
<script setup>
import PageCard from "./PageCard.vue"
import pageService from "../../services/page"
import { useI18n } from "vue-i18n"
import { ref } from "vue"
const { locale } = useI18n()
const props = defineProps({
pages: {
type: Array,
required: false,
default: () => [],
}
});
const pageList = ref([])
if (props.pages.length) {
pageList.value = props.pages;
} else {
pageService
.findAll({
params : {
"category.title": "home",
enabled: "1",
locale: locale.value,
},
})
.then(response => response.json())
.then(json => pageList.value = json["hydra:member"])
}
</script>