npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@phoenix91/vue2-crumbs

v0.1.0

Published

Breadcrumbs plugin for Vue.js 2

Readme

vue2-crumbs

Breadcrumbs plugin for Vue.js 2 allows you to customize breadcrumbs just the way you want

Features:

Installation

$ npm install @phoenix91/vue2-crumbs --save
import Vue from 'vue'
import Crumbs2 from '@phoenix91/vue2-crumbs';

Vue.use(Crumbs2);

After installation component will become available for use

Usage

Use the crumbs property in route's meta to provide route label or/and parent route name as in example below:

Simple Example

new VueRouter({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      meta: {
        crumbs: {
          label: 'Home',
          parent: '',
        },
      },
    },
    {
      path: '/posts',
      name: 'posts',
      component: Posts,
      meta: {
        crumbs: {
          label: 'Posts',
          parent: 'home',
        }
      }
    },
  ],
});

Component properties

The component vue2-crumbs has many options for customization

| Name | Type | Default | |----------------|---------|---------| | showHome | Boolean | true | | showLast | Boolean | true | | lastItemIsLink | Boolean | false | | navClass | String | '' | | listClass | String | '' | | itemClass | String | '' | | linkClass | String | '' | | lastItemClass | String | '' |

The HTML template of crumbs has the next structure

nav > ul > li > (a || span)

Label or i18n alias

If you have a multilingual application, then you can also specify i18n alias as crumb label. I18n is a higher priority property than the label

Example:

new VueRouter({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      meta: {
        crumbs: {
          i18n: 'home',
          parent: '',
        },
      },
    },
  ],
});

If you use i18n then you need to use the library vue-i18n

Specifying a parameter from the url address

If in crumb you need to specify a parameter from the url address, then you can specify it directly in the label or in the translation of the i18n alias

Example:

new VueRouter({
  routes: [
    {
      path: '/posts/:post_id(\\d+)',
      name: 'post_view',
      component: PostView,
      meta: {
        crumbs: {
          label: 'Post #:post_id',
          // or
          // i18n: 'view_post', // where decryption of view_post is "Post #:post_id" 
          parent: 'posts',
        }
      }
    },
  ],
});

Define crumbs info in page component

You can define crumbs in page components. This would overwrite data in the router. In crumbs you can return both an object and an array of objects

Example:

export default {
  crumbs() {
    return [
      {
        label: 'Posts',
        name: 'posts',
      },
      {
        label: 'Post',
        name: 'post',
      },
    ];
  },
};

Dynamic crumbs

Sometimes in crumb needs dynamic information or information from the backend. In page components in crumbs you can define it

Example:

export default {
  crumbs() {
    return [
      {
        label: 'Post "' + this.oPost.name + '"',
        name: 'post',
      },
    ];
  },
};

Attention! If you define crumbs in a page component, then you need to call function this.changeCrumbs(); This is necessary in order for the computed values to be applied (for example, getting the post from the backend). You can call it both in created() and in the function to get information from the backend

Example:

export default {
  crumbs() {
    return [
      {
        label: 'Post "' + this.oPost.name + '"',
        name: 'post',
      },
    ];
  },
  created() {
    // some actions
    this.changeCrumbs();
  },
  // or
  methods: {
    getPost() {
      axios.get('/api/posts/1')
        .then((response) => {
          this.oPost = response.data;

          this.changeCrumbs();
        });
    },
  },
};

License

MIT