<template>
    <main>
        <p>{{ globalData.magasin_explication }}</p>
        <Projects :contents="magasin" />
    </main>
</template>

<script>
import Projects from '@/components/Projects.vue';

export default {
    setup() {
        const { getItems } = useDirectusItems();
        const magasin = ref([]);
        onMounted(async () => {
            const items = await getItems({ collection: "magasin" });
            magasin.value = items;
        });

        const globalData = inject('globalData');

        return {
            globalData,
            magasin
        };
    },
    components: {
        Projects
    }
};
</script>