# Shopping Cart
import ShoppingCart from "mela-store";
# Example:
<shopping-cart
:products="data"
@increase-cart-quantity="increaseCartQuantity"
@decrease-cart-quantity="decreaseCartQuantity"
@delete-product="deleteProductFromCart"
>
</shopping-cart>
To replace native a link tags with a vue link or nuxt link, you replace the default using the available slot.
<!-- vue -->
<template v-slot:product-link="{ item }">
<VueLink :to="item.link" class="melastore-product-title">
{{ item.title }}
</VueLink>
</template>
<!-- nuxt -->
<template v-slot:product-link="{ item }">
<NuxtLink :to="item.link" class="melastore-product-title">
{{ item.title }}
</NuxtLink>
</template>
# Props
Name | Type | Default | Description |
|---|---|---|---|
| products | array | [] | An array of items/products in user's cart. |
# Slots
Name | Scopes | Description |
|---|---|---|
| product-link | item - product object | The 'Product Link' content |
# Events
Name | Arguments | Description |
|---|---|---|
| delete-product | product - selected product object | Deletes selected product from cart |
| decrease-cart-quantity | product - selected product object | Decreases cart quantity of selected item |
| increase-cart-quantity | product - selected product object | Increase cart quantity of selected item |
# Notes
- Object keys in products props array should satisfy default values.