Commit 56172b05 authored by Garima Jain's avatar Garima Jain

emit remove cart item event

parent e9ba650b
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{ {
"name": "mcart", "name": "mcart",
"version": "0.1.13", "version": "0.1.15",
"private": false, "private": false,
"main": "./dist/mComponents.common.js", "main": "./dist/mComponents.common.js",
"files": [ "files": [
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</div> </div>
<div :style="displaying"> <div :style="displaying">
<div> <div>
<p><b>Sihip it </b></p> <p><b>Ship it </b></p>
<p> <p>
<span class="green">In Stock: </span> Usually ships within 3 <span class="green">In Stock: </span> Usually ships within 3
business days. business days.
...@@ -90,18 +90,8 @@ export default { ...@@ -90,18 +90,8 @@ export default {
}, },
methods: { methods: {
deleteCartItem(id) { deleteCartItem(id) {
fetch("https://fakestoreapi.com/products/" + id).then((res) => { this.$emit('delete_cart_item', id)
console.log("==", res); }
});
var index = this.list
.map((x) => {
return x.id;
})
.indexOf(id);
this.list.splice(index, 1);
},
}, },
mounted() { mounted() {
this.loading = true; //the loading begin this.loading = true; //the loading begin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment