Answer the question
In order to leave comments, you need to log in
How to connect button and components?
Tell me how to connect 2 components: one with a button, when clicked, the second component with content is called?
Answer the question
In order to leave comments, you need to log in
I do like this, but I don't have select ...
In template :
<ul class="uk-nav">
<li class="uk-button-primary uk-button"
v-for="item in items"
v-bind:key="item.id"
v-on:click="CurrentComponent = (item.component)"
>{{ item.name }}
</li>
</ul>
...
<div class="uk-placeholder uk-margin-top">
<component v-bind:is="CurrentComponent"></component>
</div>
...
import PageOpen from './PageOpen';
data: function init() {
return {
items: [
{id: 40,
component: PageOpen,
name: 'Кто может стать участником программы',},
],
CurrentComponent: Home, // НЕ забываем что CurrentComponent нужно чем то заполнить. Default.
},.....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question