I have a problem
i have an app a system i want to add product
I have an array, although there are 2 objects in it, when I print it in the console, only one comes and it does not come as an object.
at the same time, when I add another object to my product list, it gets the same model in the same product.name
for example I have 5 objects The variable names in the object are all the same.
Changing the value of one variable also changes the value of all other variables.
please help me
interface sevkiyatModal {
product_informations: object[];
}
d
const formValues = ref<sevkiyatModal>({
product_informations: [
{
id: null,
name: null,
amount: null,
unit: null,
shelf_life: null,
description: null,
},
{
id: null,
name: null,
amount: null,
unit: null,
shelf_life: null,
description: null,
},
],
});
as it seems, there are 2 on the console and 1 on the console
here is each column
<div
v-for="(product, i) in formValues.product_informations"
:key="i"
class="d-grid"
style="grid-template-columns: repeat(5, minmax(0, 1fr))"
>
<ExField class="mx-1" label="Ürün Adı" name="product_informations.name" placeholder="Ürün adı giriniz" />
<ExField class="mx-1" label="Miktar" name="product_informations.amount" placeholder="Miktar giriniz" />
<ExField class="mx-1" label="Birim" name="product_informations.unit" placeholder="Birim giriniz" />
<ExField
class="mx-1"
label="Raf Ömrü"
name="product_informations.shelf_life"
placeholder="Raf ömrü giriniz"
/>
<ExField
class="mx-1"
label="Açıklama"
name="product_informations.description"
placeholder="Açıklama giriniz"
/>
</div>