new changes
This commit is contained in:
@@ -17,10 +17,16 @@ defineProps<Props>();
|
||||
|
||||
// state
|
||||
|
||||
const { data : homeData } = useHomeData();
|
||||
const { data: homeData, suspense } = useHomeData();
|
||||
|
||||
const swiper_instance = ref<SwiperClass | null>(null);
|
||||
|
||||
// queries
|
||||
|
||||
await useAsyncData(async () => {
|
||||
await suspense();
|
||||
});
|
||||
|
||||
// methods
|
||||
|
||||
const onSwiper = (swiper: SwiperClass) => {
|
||||
@@ -79,7 +85,10 @@ const onSwiper = (swiper: SwiperClass) => {
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<Swiper :slides-per-view="3" :space-between="24" @swiper="onSwiper">
|
||||
<SwiperSlide v-for="product in homeData!.products" :key="product.id">
|
||||
<SwiperSlide
|
||||
v-for="product in homeData!.products"
|
||||
:key="product.id"
|
||||
>
|
||||
<ProductCard
|
||||
:id="product.id"
|
||||
brand="برند محصول"
|
||||
|
||||
Reference in New Issue
Block a user