Skip to content

Commit

Permalink
ughghghgh how to put in cart
Browse files Browse the repository at this point in the history
  • Loading branch information
JessL868 committed Feb 11, 2025
1 parent df664ac commit 06155dd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
13 changes: 13 additions & 0 deletions app/src/components/GroceryCart.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div>
<h1>Cart</h1>
</div>
</template>

<script setup>
cart = [];
</script>

<style scoped>
</style>
1 change: 1 addition & 0 deletions app/src/components/ProductCss.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div>
<h2 class="card">{{ product.name }} <br> {{ product.cost }}</h2>
<slot></slot>
</div>
</template>

Expand Down
5 changes: 2 additions & 3 deletions app/src/components/ShopProduce.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<template>
<div>
<div class="container">
<ProductCss @click="ordered = ordered" v-for="product in products" :key="product.name" :product = "product"/>
<ProductCss @click="console.log(product)" v-for="product in products" :key="product.name" :product = "product">Add to Cart</ProductCss>
</div>
<h1 v-if="ordered">hi</h1>
</div>
</template>

<script setup>
import HomeView from '../components/HomeView.vue'
import cart from '../components/GroceryCart.vue'
import ProductCss from '../components/ProductCss.vue'
const products = [
{name: "Broccoli (per lb)",
Expand Down
3 changes: 2 additions & 1 deletion app/src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<div>
<h1>Cart</h1>
<GroceryCart/>
</div>
</template>

<script setup>
import GroceryCart from '../components/GroceryCart.vue'
</script>

<style scoped>
Expand Down

0 comments on commit 06155dd

Please sign in to comment.