Answer the question
In order to leave comments, you need to log in
How to pass data to modal window?
In general I have 2 or more data arrays. They are not related to each other. They are rendered by v-forom as a list below each other, passing data to the component. And so it is necessary for me that at a clique there was a modal window with the filled data which I can edit. Accordingly, the configuration of the modal differs depending on the array with data. How to do it all right?
Of course, it begs to shove the modal inside the iterable component. But these components can be many. And not ice, probably in terms of performance.
Answer the question
In order to leave comments, you need to log in
If we talk about some primitive example, then you can do this:
<template>
<div>
<div v-for="item in items" @click="currentItem=item; show=true"></div>
<modal v-if="show" @close="show=false" :data="currentItem">
</div>
</template>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question