Answer the question
In order to leave comments, you need to log in
How do I install vue-2-breadcrumbs?
UPD: I just forgot to run npm
Let's leave comments about my mental abilities. However, I need to somehow install the vue-2-breadcrumbs plugin ( https://www.npmjs.com/package/vue-2-breadcrumbs ). How can I do it?
More precisely, what do I need to add to the code so that everything works on the template page?
import Vue from 'vue'
import VueRouter from 'vue-router';
import VueBreadcrumbs from 'vue-2-breadcrumbs';
import home from "./pages/home.vue";
import projects from "./pages/projects.vue";
import services from "./pages/services.vue";
import contacts from "./pages/contacts.vue";
import siteHeader from './components/header/headerLayout.vue'
import siteFooter from './components/siteFooter.vue'
Vue.use(VueBreadcrumbs);
Vue.use(VueRouter);
const routes = [
{
path: '/',
name: 'Главная',
component: home
},
{
path: '/projects',
name: 'Проекты',
component: projects
},
{
path: '/services',
name: 'Услуги',
component: services
},
{
path: '/contacts',
name: 'Контакты',
component: contacts
},
]
const router = new VueRouter({
mode: 'history',
routes // сокращённая запись для `routes: routes`
})
const app = new Vue({
el: '#app',
router: router,
data: {},
components: {
siteHeader,
siteFooter,
}
});
<div id="app" v-cloak>
<site-header></site-header>
<Breadcrumbs/>
<main class="container__main">
<router-view></router-view>
</main>
<site-footer></site-footer>
</div>
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