File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed
Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,24 @@ class VueBreadcrumbs implements PluginObject<ComponentOptions<Vue>> {
154154 if ( crumb ?. meta ?. breadcrumb ) {
155155 const label = this . getBreadcrumb ( crumb . meta . breadcrumb ) ;
156156 if ( label ?. length > 0 ) {
157+ let item ;
158+ if ( index !== this . $breadcrumbs . length - 1 ) {
159+ item = createElement (
160+ 'router-link' ,
161+ {
162+ props : {
163+ to : { path : this . getPath ( crumb ) } ,
164+ tag : 'a'
165+ }
166+ } ,
167+ ` ${ label } `
168+ ) ;
169+ }
170+ else {
171+ item = createElement (
172+ 'span' , ` ${ label } `
173+ ) ;
174+ }
157175 return createElement (
158176 'li' ,
159177 {
@@ -165,16 +183,7 @@ class VueBreadcrumbs implements PluginObject<ComponentOptions<Vue>> {
165183 }
166184 } ,
167185 [
168- createElement (
169- 'router-link' ,
170- {
171- props : {
172- to : { path : this . getPath ( crumb ) } ,
173- tag : index !== this . $breadcrumbs . length - 1 ? 'a' : 'span'
174- }
175- } ,
176- ` ${ label } `
177- )
186+ item
178187 ]
179188 )
180189 }
You can’t perform that action at this time.
0 commit comments