Answer the question
In order to leave comments, you need to log in
How to draw a new component instance every time on click?
In the project, on click, the component should be added to the list and rendered. How to draw it not once, but every time when clicked?
Now done as a modal window:
newCell(v-if="showCell")
show : false,
showCell () {
this.show = true;
}
Answer the question
In order to leave comments, you need to log in
In the parent, set up a counter of child component instances:
data: () => ({
repeat: 0,
}),
<child-component v-for="i in repeat"></child-component>
<button @click="repeat++">add one more child component instance</button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question