From 0d754f93f571be779998bdb62f63184c2ddc71a0 Mon Sep 17 00:00:00 2001 From: adb-sh Date: Sun, 8 Jan 2023 17:58:11 +0100 Subject: [PATCH] add more users and description field --- src/components/AddItemForm.vue | 7 +++++++ src/components/EditItemForm.vue | 7 +++++++ src/components/ItemList.vue | 2 +- src/store/dummyData.ts | 23 +++++++++++++++++++++-- src/views/EditItem.vue | 2 +- src/views/ShoppingList.vue | 2 +- 6 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/components/AddItemForm.vue b/src/components/AddItemForm.vue index 13cf66f..e2c1f24 100644 --- a/src/components/AddItemForm.vue +++ b/src/components/AddItemForm.vue @@ -11,6 +11,7 @@ const item = reactive({ name: '', price: 0.99, user: '', + description: '', }); const form = ref(null); @@ -20,6 +21,7 @@ const submit = () => { name: item.name, price: item.price * 100, user: store.users.find(user => user.name === item.user), + description: item.description, }); router.push('/shopping-list'); }; @@ -38,6 +40,11 @@ const submit = () => { required v-model="item.price" /> + { props.item.name = item.name; props.item.price = item.price * 100; props.item.user = store.users.find(user => user.name === item.user); + props.item.description = item.description; router.push('/shopping-list'); }; @@ -40,6 +42,11 @@ const submit = () => { required v-model="item.price" /> + {{ item.name }} - {{ item.price / 100 }} € + {{ item.description }} - {{ item.price / 100 }} €