Answer the question
In order to leave comments, you need to log in
Dynamic rendering of a component in vue?
<template>
<div>
<component :is="login"></component>
<header class="header" >
<div class="header__logo">
<a href="index.html"><img height="34" width="130" src="../assets/img/icon2.svg" alt=""></a>
</div>
<div class="header__nav">
<nav class="header__nav__nav">
<a href="#">О проекте</a>
<a href="#">FAQs</a>
<a href="#">
<button class="btn btn--sm" @click="component='login'">Начать</button>
</a>
</nav>
</div>
</header>
</div>
</template>
<script>
import login from './login.vue'
export default {
components: {
login
},
data() {
return {
component:'login'
}
},
methods: {
login: function () {
//????
}
}
}
</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