added no cart item style
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import useGetOrdersCart from "~/composables/api/orders/useGetOrdersCart";
|
||||||
|
|
||||||
// state
|
// state
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -7,6 +9,16 @@ const route = useRoute();
|
|||||||
|
|
||||||
const pageTitle = computed(() => route.meta.pageTitle);
|
const pageTitle = computed(() => route.meta.pageTitle);
|
||||||
const prevPage = computed(() => route.meta.prevPage);
|
const prevPage = computed(() => route.meta.prevPage);
|
||||||
|
|
||||||
|
// queries
|
||||||
|
|
||||||
|
const { data: cart } = useGetOrdersCart();
|
||||||
|
|
||||||
|
// computed
|
||||||
|
|
||||||
|
const hasCartItem = computed(
|
||||||
|
() => !!cart.value && cart.value.items.length! > 0
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -52,12 +64,13 @@ const prevPage = computed(() => route.meta.prevPage);
|
|||||||
class="w-full flex flex-col items-center relative justify-between gap-8 lg:gap-6 lg:flex-row lg:items-start"
|
class="w-full flex flex-col items-center relative justify-between gap-8 lg:gap-6 lg:flex-row lg:items-start"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="flex flex-col w-full gap-4 lg:gap-6 lg:w-9/12 shrink-0"
|
class="flex flex-col w-full gap-4 lg:gap-6 shrink-0"
|
||||||
|
:class="hasCartItem ? 'lg:w-9/12' : ''"
|
||||||
>
|
>
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CartSummary />
|
<CartSummary v-if="hasCartItem" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ProductsSlider title="دیگران این محصولات را هم خریدهاند" />
|
<ProductsSlider title="دیگران این محصولات را هم خریدهاند" />
|
||||||
|
|||||||
Reference in New Issue
Block a user