mahee-auffret/pages/magasin.vue

68 lines
1.5 KiB
Vue
Raw Normal View History

2024-02-21 00:30:14 +01:00
<template>
<main>
<p>{{ globalData.magasin_explication }}</p>
<div class="category">
<div>
<h3>Toiles</h3>
<Projects :contents="toiles" />
</div>
<div>
<h3>Impressions</h3>
<Projects :contents="prints" />
</div>
</div>
2024-02-21 00:30:14 +01:00
</main>
</template>
<script>
import Projects from '@/components/Projects.vue';
export default {
async setup() {
const toiles = ref([]);
const prints = ref([]);
const { data: toilesData } = useFetch('/api/items/toiles', { server: true });
const { data: printsData } = useFetch('/api/items/prints', { server: true });
onBeforeMount(async () => {
if (toilesData.value) {
toiles.value = toilesData.value.data;
}
if (printsData.value) {
prints.value = printsData.value.data;
}
2024-02-21 00:30:14 +01:00
});
let globalData = await useFetchGlobalData();
globalData = globalData.globalData._object.$sglobalData;
2024-02-21 00:30:14 +01:00
return {
globalData,
toiles,
prints
2024-02-21 00:30:14 +01:00
};
},
components: {
Projects
}
};
</script>
<style scoped lang="scss">
h3:first-of-type {
margin-top: 2rem;
}
h3 {
text-transform: uppercase;
}
@media screen and (min-width: 800px) {
.category {
display: flex;
> div {
width: 50%;
}
}
}
</style>