{"id":13424080,"url":"https://github.com/samturrell/vue-breadcrumbs","last_synced_at":"2025-10-22T18:24:35.126Z","repository":{"id":52907984,"uuid":"56447788","full_name":"samturrell/vue-breadcrumbs","owner":"samturrell","description":"Breadcrumbs for Vue.js","archived":true,"fork":false,"pushed_at":"2021-04-14T10:29:22.000Z","size":49,"stargazers_count":146,"open_issues_count":6,"forks_count":27,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-13T06:12:44.926Z","etag":null,"topics":["breadcrumbs","javascript","plugin","vue","vue-breadcrumbs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samturrell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-17T16:54:10.000Z","updated_at":"2024-08-23T02:24:48.000Z","dependencies_parsed_at":"2022-08-30T20:01:14.973Z","dependency_job_id":null,"html_url":"https://github.com/samturrell/vue-breadcrumbs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samturrell%2Fvue-breadcrumbs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samturrell%2Fvue-breadcrumbs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samturrell%2Fvue-breadcrumbs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samturrell%2Fvue-breadcrumbs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samturrell","download_url":"https://codeload.github.com/samturrell/vue-breadcrumbs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221601255,"owners_count":16850309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["breadcrumbs","javascript","plugin","vue","vue-breadcrumbs"],"created_at":"2024-07-31T00:00:48.176Z","updated_at":"2025-10-22T18:24:34.812Z","avatar_url":"https://github.com/samturrell.png","language":"JavaScript","funding_links":[],"categories":["Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","JavaScript","公用事业","Components \u0026 Libraries","Utilities","Awesome Vue.js","Utilities [🔝](#readme)"],"sub_categories":["Libraries \u0026 Plugins","页面导航","Utilities","Page Navigation"],"readme":"# vue-breadcrumbs\n\n[![npm](https://img.shields.io/npm/dt/vue-breadcrumbs.svg)](https://www.npmjs.com/package/vue-breadcrumbs)\n[![npm](https://img.shields.io/npm/v/vue-breadcrumbs.svg)](https://www.npmjs.com/package/vue-breadcrumbs)\n[![GitHub stars](https://img.shields.io/github/stars/samturrell/vue-breadcrumbs.svg?style=social\u0026label=Star)](http://github.com/samturrell/vue-breadcrumbs)\n\nVue 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.\n \n[DEMO](https://samturrell.github.io/vue-breadcrumbs/example)\n\n## Installation\n```html\n\u003cscript src=\"../dist/vue-breadcrumbs.min.js\"\u003e\u003c/script\u003e\n```\n\n```js\nVue.use(VueBreadcrumbs)\n```\n\nor via npm:\n\n```sh\n$ npm install vue-breadcrumbs\n```\n\n```js\nimport VueBreadcrumbs from 'vue-breadcrumbs'\n\nVue.use(VueBreadcrumbs)\n```\n\nDefine the matching breadcrumb text in your routes.\n\nAn options object can also be passed into the plugin to specify your own template and rendering methods if desired. For example:\n\n```js\nVue.use(VueBreadcrumbs, {\n  template: '\u003cnav class=\"breadcrumb\" v-if=\"$breadcrumbs.length\"\u003e ' +\n    '\u003crouter-link class=\"breadcrumb-item\" v-for=\"(crumb, key) in $breadcrumbs\" :to=\"linkProp(crumb)\" :key=\"key\"\u003e{{ crumb | crumbText }}\u003c/router-link\u003e ' +\n    '\u003c/nav\u003e'\n});\n```\n\nBy default the plugin will autoregister a `breadcrumbs` component which is globally accessible in your app (thanks to [HermannBjorgvin](https://github.com/HermannBjorgvin). To disable this functionality you can set the `registerComponent` option to `false` when registering the component, like so:\n\n```js\nVue.use(VueBreadcrumbs, {\n  registerComponent: false\n});\n```\n\nNote: if referencing directly in the browser rather than as a module, there is no way to stop the default component from registering.\n\n## Usage\n### Vue 1.x \n\nUse the `breadcrumb:` property of a route or subRoute, e.g.:\n\n```js\nrouter.map({\n  '/': {\n    component: Page,\n    breadcrumb: 'Home Page',\n    subRoutes: {\n      '/foo': {\n        component: Foo,\n        breadcrumb: 'Foo Page'\n      },\n      '/bar': {\n        component: Bar,\n        breadcrumb: 'Bar Page'\n      }\n    }\n  }\n})\n```\n \n### Vue 2.x\n\nUse the `meta.breadcrumb:` property of a route or child route, e.g.:\n\n```js\nnew VueRouter({\n  routes: [\n    {\n      path: '/', \n      component: Page,\n      meta: {\n        breadcrumb: 'Home Page',\n      },\n      children: [\n        {\n          path: '/foo', \n          component: Foo,\n          meta: {\n            breadcrumb: 'Foo Page'  \n          }\n        },\n        {\n          path: '/bar', \n          component: Bar,\n          meta: {\n            breadcrumb: 'Bar Page'\n          }\n        }\n      ]\n    }\n  ]\n})\n```\n\nYou can then render the breadcrumbs using the included `\u003cbreadcrumbs\u003e` component or using your own markup logic with the global `this.$breadcrumbs` property which will return an array of active matched routes.\n\n# License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamturrell%2Fvue-breadcrumbs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamturrell%2Fvue-breadcrumbs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamturrell%2Fvue-breadcrumbs/lists"}