Something went wrong. Try again.
An E-Commerce Website built using Vue.js, Firebase Technologies: Firebase Authentication, Firebase Realtime Database, Firestore, and Fireba… cipher-vue-shop.web.app
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647<template> <div class="addToCart"> <button class="btn btn-primary" @click="addToCart()"> Add to Cart </button> </div></template>
<script>export default { name: "addToCart", props: { name: String, price: String, image: String, pId: String },
data(){ return { item :{ productName: this.name, productImage: this.image, productPrice: this.price, productId: this.pId, productQuantity: 1, }
} }, methods:{ addToCart(){ $('#miniCart').modal('show'); this.$store.commit('addToCart', this.item) } }
};</script>
<!-- Add "scoped" attribute to limit CSS to this component only --><style scoped lang="scss">
</style>