Answer the question
In order to leave comments, you need to log in
How to properly resolve the issue in VueJS?
Started learning VueJS.
And here I ran into a problem.
There is data:
{
items: [
{
id: 1,
name: 'Lawnmower',
fields: [
{
name: 'Horsepower',
type: 'number',
value: '717',
default: '0'
}
]
}
]
}
v-for="item in items"
v-on:click="editItem(item)"
), a function is triggered that takes the current item. The function opens a modal window where item.name and item.fields should be displayed. Answer the question
In order to leave comments, you need to log in
1) Make the modal a component and pass item through props.
2) Make the selectedItem variable, and set it in editItem, and use it in the modal.
Choose.
Create more model_name and modal_fields variables with empty values. When clicked, equate them to the values of item.name and fields respectively. When closing the modal, clear them again
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question