Answer the question
In order to leave comments, you need to log in
How to wire functional components inside a functional component?
Here is the code for the
Main Component:
<template functional>
<div class="tariff-item">
<div class="tariff-item__top">
<h3 class="tariff-item__title"></h3>
<ul class="tariff-item__list">
<li
class="tariff-item__item"
v-for="item in items"
>
</li>
</ul>
</div>
<div class="tariff-item__bottom">
<p class="tariff-item__price">{{ price }}</p>
<p class="tariff-item__time">{{ time }}</p>
<Button
:title="Кнопка"
/>
</div>
</div>
</template>
<script>
import Button from '../elements/Button';
export default {
functional: true,
name: "TariffItem",
components: {
Button
}
}
</script>
<template functional>
<button
class="button"
@click="clickFunc"
>
{ title }
</button>
</template>
<script>
export default {
functional: true,
name: "Button",
props: {
'title': {
type: String,
default: ''
},
'clickFunc': {
type: Function,
default: () => {}
}
},
}
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question