Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
vue-breadcrumbs
Advanced tools
Vue breadcrumbs builds on the official vue-router package to provide simple breadcrumbs. This package is backwards compatible to support both Vue 1.x and Vue 2.x.
<script src="../dist/vue-breadcrumbs.min.js"></script>
Vue.use(VueBreadcrumbs)
or via npm:
$ npm install vue-breadcrumbs
import VueBreadcrumbs from 'vue-breadcrumbs'
Vue.use(VueBreadcrumbs)
Define the matching breadcrumb text in your routes.
An options object can also be passed into the plugin to specify your own template and rendering methods if desired. For example:
Vue.use(VueBreadcrumbs, {
template: '<nav class="breadcrumb" v-if="$breadcrumbs.length"> ' +
'<router-link class="breadcrumb-item" v-for="(crumb, key) in $breadcrumbs" :to="linkProp(crumb)" :key="key">{{ crumb | crumbText }}</router-link> ' +
'</nav>'
});
By default the plugin will autoregister a breadcrumbs
component which is globally accessible in your app (thanks to HermannBjorgvin. To disable this functionality you can set the registerComponent
option to false
when registering the component, like so:
Vue.use(VueBreadcrumbs, {
registerComponent: false
});
Note: if referencing directly in the browser rather than as a module, there is no way to stop the default component from registering.
Use the breadcrumb:
property of a route or subRoute, e.g.:
router.map({
'/': {
component: Page,
breadcrumb: 'Home Page',
subRoutes: {
'/foo': {
component: Foo,
breadcrumb: 'Foo Page'
},
'/bar': {
component: Bar,
breadcrumb: 'Bar Page'
}
}
}
})
Use the meta.breadcrumb:
property of a route or child route, e.g.:
new VueRouter({
routes: [
{
path: '/',
component: Page,
meta: {
breadcrumb: 'Home Page',
},
children: [
{
path: '/foo',
component: Foo,
meta: {
breadcrumb: 'Foo Page'
}
},
{
path: '/bar',
component: Bar,
meta: {
breadcrumb: 'Bar Page'
}
}
]
}
]
})
You can then render the breadcrumbs using the included <breadcrumbs>
component or using your own markup logic with the global this.$breadcrumbs
property which will return an array of active matched routes.
FAQs
Breadcrumbs for vue.js
The npm package vue-breadcrumbs receives a total of 770 weekly downloads. As such, vue-breadcrumbs popularity was classified as not popular.
We found that vue-breadcrumbs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.