diff --git a/src/components/EditItemForm.vue b/src/components/EditItemForm.vue
new file mode 100644
index 0000000..a8cc74d
--- /dev/null
+++ b/src/components/EditItemForm.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+ edit item
+
+
diff --git a/src/components/ItemList.vue b/src/components/ItemList.vue
index 81b68c3..88e36c1 100644
--- a/src/components/ItemList.vue
+++ b/src/components/ItemList.vue
@@ -12,9 +12,13 @@ defineProps({
{{ user }}
-
+
{{ item.name }}
{{ item.price / 100 }} €
+
+
+
+
diff --git a/src/router/index.ts b/src/router/index.ts
index 6728da9..322c416 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -2,6 +2,7 @@ import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import HomeView from '../views/HomeView.vue';
import ShoppingList from '../views/ShoppingList.vue';
import AddItem from '../views/AddItem.vue';
+import EditItem from '../views/EditItem.vue';
const routes: Array = [
{
@@ -19,6 +20,11 @@ const routes: Array = [
name: "add-item",
component: AddItem,
},
+ {
+ path: "/edit-item/:id",
+ name: "edit-item",
+ component: EditItem,
+ },
];
const router = createRouter({
diff --git a/src/store/dummyData.ts b/src/store/dummyData.ts
index daf0013..5c1f687 100644
--- a/src/store/dummyData.ts
+++ b/src/store/dummyData.ts
@@ -14,17 +14,20 @@ export const dummyList = [
price: 200,
user: lukas,
isBought: false,
+ id: 0,
},
{
name: 'Apple',
price: 150,
user: lukas,
isBought: false,
+ id: 1,
},
{
name: 'Butter',
price: 149,
user: laura,
isBought: false,
+ id: 2,
},
];
diff --git a/src/store/shoppingList.ts b/src/store/shoppingList.ts
index af0a168..21eef3d 100644
--- a/src/store/shoppingList.ts
+++ b/src/store/shoppingList.ts
@@ -10,6 +10,7 @@ type ShoppingItem = {
price: number;
isBought: boolean;
user: User;
+ id: number;
};
export const useShoppingListStore = defineStore('shoppingList', {
diff --git a/src/views/EditItem.vue b/src/views/EditItem.vue
new file mode 100644
index 0000000..0b3381d
--- /dev/null
+++ b/src/views/EditItem.vue
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
This item does not exist.
+
back to shopping list
+
+
+
+