38 lines
872 B
Vue
38 lines
872 B
Vue
<script lang="ts" setup>
|
|
|
|
// import
|
|
|
|
import useHomeData from "~/composables/api/home/useHomeData";
|
|
import ProductsGrid from "~/components/global/ProductsGrid.vue";
|
|
|
|
// state
|
|
|
|
const { data: homeData, suspense } = useHomeData();
|
|
|
|
// ssr
|
|
|
|
const response = await suspense();
|
|
|
|
if (response.isError) {
|
|
throw createError({
|
|
statusCode: 500,
|
|
statusMessage: `Landing error : ${response.error.message}`
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<div class="w-full">
|
|
<LoadingOverlay />
|
|
<Hero />
|
|
<Preview />
|
|
<ProductsShowcase />
|
|
<!-- <ProductsSlider title="محصولات پرفروش" />-->
|
|
<ProductsGrid title="محصولات پرفروش" :products="[...homeData!.products,...homeData!.products]"/>
|
|
<Categories />
|
|
<Brands />
|
|
<MostRecentComments />
|
|
<LatestStories />
|
|
</div>
|
|
</template> |