Answer the question
In order to leave comments, you need to log in
Insert component by class?
I have 3 elements on the page with the class .day-1 .day-2 .day-3
Depending on the prop, the component needs to be rendered where needed, in JS it could be like this:
document.querySelector(`.day-${day}`).append('<div>....</div>');
Answer the question
In order to leave comments, you need to log in
Although it is better to output in a loop and draw only what is needed (v-for)
<div v-show="prop === 1"><div class="component"></div></div>
<div v-show="prop === 2"><div class="component"></div></div>
<div v-show="prop === 3"><div class="component"></div></div>
It is clear that it comes to you through props, drove into data, in principle, the essence is the sameDidn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question