42 lines
955 B
Vue
42 lines
955 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 class="mb-20 max-md:mt-[80px]" />
|
|
<Preview />
|
|
<ProductsShowcase class="mb-40" />
|
|
<ProductsGrid
|
|
title="محصولات پرفروش"
|
|
:products="[...homeData!.products,...homeData!.products]"
|
|
/>
|
|
<Categories class="mt-40" />
|
|
<Brands />
|
|
<MostRecentComments />
|
|
<ClientOnly>
|
|
<LatestStories class="mb-20" />
|
|
</ClientOnly>
|
|
</div>
|
|
</template> |