Answer the question
In order to leave comments, you need to log in
Is it possible to use several templates at once within one single VueJS component and how to call them?
Is it possible to place several templates inside one component?
<template>
<div>
1-ый
</div>
</template>
<template>
<div>
2-рой
</div>
</template>
Answer the question
In order to leave comments, you need to log in
It would be good practice to create separate components and combine them into one parent, where they will be dynamically imported, and the "component(:is="<desired component>") element will be responsible for displaying the desired component. I want to create files, I don’t understand why not do this:
<template>
.component-1(v-if="blah")
// код компонента
.component-2(v-else-if="blah-blah")
// код второго компонента
// и так далее
</template>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question