68 lines
1.5 KiB
Vue
68 lines
1.5 KiB
Vue
<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>
|
|
</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;
|
|
}
|
|
});
|
|
|
|
let globalData = await useFetchGlobalData();
|
|
globalData = globalData.globalData._object.$sglobalData;
|
|
|
|
return {
|
|
globalData,
|
|
toiles,
|
|
prints
|
|
};
|
|
},
|
|
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> |