|
|
@ -15,6 +15,7 @@ const item = reactive({
|
|
|
|
name: props.item.name,
|
|
|
|
name: props.item.name,
|
|
|
|
price: props.item.price / 100,
|
|
|
|
price: props.item.price / 100,
|
|
|
|
user: props.item.user.name,
|
|
|
|
user: props.item.user.name,
|
|
|
|
|
|
|
|
description: props.item.description,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const form = ref(null);
|
|
|
|
const form = ref(null);
|
|
|
@ -23,6 +24,7 @@ const submit = () => {
|
|
|
|
props.item.name = item.name;
|
|
|
|
props.item.name = item.name;
|
|
|
|
props.item.price = item.price * 100;
|
|
|
|
props.item.price = item.price * 100;
|
|
|
|
props.item.user = store.users.find(user => user.name === item.user);
|
|
|
|
props.item.user = store.users.find(user => user.name === item.user);
|
|
|
|
|
|
|
|
props.item.description = item.description;
|
|
|
|
router.push('/shopping-list');
|
|
|
|
router.push('/shopping-list');
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
@ -40,6 +42,11 @@ const submit = () => {
|
|
|
|
required
|
|
|
|
required
|
|
|
|
v-model="item.price"
|
|
|
|
v-model="item.price"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
<v-text-field
|
|
|
|
|
|
|
|
label="Description"
|
|
|
|
|
|
|
|
required
|
|
|
|
|
|
|
|
v-model="item.description"
|
|
|
|
|
|
|
|
/>
|
|
|
|
<v-select
|
|
|
|
<v-select
|
|
|
|
label="User"
|
|
|
|
label="User"
|
|
|
|
:items="store.users.map(user => user.name)"
|
|
|
|
:items="store.users.map(user => user.name)"
|
|
|
|