Answer the question
In order to leave comments, you need to log in
How to make a component with reuse of other components?
To use vue with bootstrap I tried bootstrap-vue. in principle, everything worked, I want to make "beauty".
When using vue-router, the router-link component is rendered in
when used in the header, the b-nav-item component is rendered in
If done manually instead of b-nav-item<a>
<li class="nav-item"><a class="nav-link">
<li class="nav-item"><router-link class="nav-link">
- then everything works. Vue.component('b-router-link', {
template: '<li class="nav-item"><a class="nav-link"><slot/></a></li>'
})
Vue.component('b-router-link', {
template: '<li class="nav-item"><router-link :to class="nav-link"><slot/></router-link></li>'
})
Answer the question
In order to leave comments, you need to log in
I figured out the correct component is:
Vue.component('b-router-link', {
template: '<li class="nav-item"><router-link :to="to" class="nav-link"><slot/></router-link></li>',
props: ['to']
})
<b-router-link to="/phones">Телефоны</b-router-link>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question