File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ Vue.use(VueRouter);
4545Vue .use (VueBreadcrumbs);
4646
4747const Feeds = {template: ' <div><router-view/></div>' };
48+ const Feed = {template: ' <div><h2>Feed</h2></div>' };
4849const Biz = {template: ' <div><h2>Biz</h2></div>' };
4950const Foo = {template: ' <div><h2>Foo</h2></div>' };
5051const Bar = {template: ' <div><h2>Bar</h2></div>' };
@@ -76,6 +77,13 @@ const router = new VueRouter({
7677 meta: {
7778 breadcrumb: ' bar'
7879 }
80+ },
81+ {
82+ path: ' :id' ,
83+ component: Feed,
84+ meta: {
85+ breadcrumb : (routeParams ) => ` Other Feed ${ routeParams .id } `
86+ }
7987 }
8088 ]
8189 }
@@ -92,6 +100,9 @@ new Vue({
92100 <div class="dropdown-menu">
93101 <router-link to="/feeds/foo" class="dropdown-item">Foo</router-link>
94102 <router-link to="/feeds/bar" class="dropdown-item">Bar</router-link>
103+ <router-link to="/feeds/1" class="dropdown-item">Other Feed 1</router-link>
104+ <router-link to="/feeds/2" class="dropdown-item">Other Feed 2</router-link>
105+ <router-link to="/feeds/3" class="dropdown-item">Other Feed 3</router-link>
95106 </div>
96107 </li>
97108 </ul>
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default {
2020 Vue . component ( 'breadcrumbs' , {
2121 methods : {
2222 getBreadcrumb : function ( bc ) {
23- return typeof bc === 'function' ? bc ( ) : bc
23+ return typeof bc === 'function' ? bc ( this . $route . params ) : bc
2424 }
2525 } ,
2626 template : `
You can’t perform that action at this time.
0 commit comments