D
D
Dmitry Baskakov2020-10-27 19:44:00
Vue.js
Dmitry Baskakov, 2020-10-27 19:44:00

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?

my code

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,
    }
});


and here is the template

<div id="app" v-cloak>
            <site-header></site-header>
            <Breadcrumbs/>
            <main class="container__main">
                <router-view></router-view>
            </main>
            <site-footer></site-footer>
        </div>


all this is Laravel + vue if it matters

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Erl, 2020-10-27
@NooBiToo

{
      path: '/',
      name: 'Home',
      component: { template: '<h2>Home</h2>' },
      meta: {
        breadcrumb: 'Home'
      }
    },

you don't have meta

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question