mahee-auffret/pages/magasin.vue

77 lines
1.7 KiB
Vue
Raw Permalink Normal View History

2024-02-21 00:30:14 +01:00
<template>
<main>
2024-05-28 00:18:18 +02:00
<Brush />
2024-02-21 00:30:14 +01:00
<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';
2024-05-28 00:18:18 +02:00
import Brush from '@/components/Brush.vue';
2024-02-21 00:30:14 +01:00
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 });
onMounted(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: {
2024-05-28 00:18:18 +02:00
Projects,
Brush
2024-02-21 00:30:14 +01:00
}
};
</script>
<style scoped lang="scss">
h3:first-of-type {
margin-top: 3rem;
}
h3 {
text-transform: uppercase;
}
div > h3 + main {
margin-top: 3vh;
}
@media screen and (min-width: 800px) {
div > h3 + main {
margin-top: 4vh;
}
.category {
display: flex;
> div {
width: 50%;
}
}
}
</style>