Refine catalog cart controls and show cart badge in header
This commit is contained in:
@@ -6,6 +6,7 @@ type NavItem = {
|
||||
};
|
||||
|
||||
const route = useRoute();
|
||||
const { totalItems } = useClientCart();
|
||||
|
||||
const leftCapsule: NavItem[] = [
|
||||
{ to: '/profile', label: 'Профиль', icon: 'user' },
|
||||
@@ -83,6 +84,9 @@ function isActive(path: string) {
|
||||
<path d="M7 4h-2l-1 2v2h1l2.2 9h10.6l2.2-7H8.3L7.8 8H21V6h-12l-1-2Zm2 16a2 2 0 1 0 0 .01V20Zm8 0a2 2 0 1 0 0 .01V20Z" fill="currentColor" />
|
||||
</svg>
|
||||
{{ item.label }}
|
||||
<span v-if="item.to === '/cart' && totalItems > 0" class="badge badge-sm border-0 bg-[#139957] text-white">
|
||||
{{ totalItems }}
|
||||
</span>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user