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>> {
154
154
if ( crumb ?. meta ?. breadcrumb ) {
155
155
const label = this . getBreadcrumb ( crumb . meta . breadcrumb ) ;
156
156
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
+ }
157
175
return createElement (
158
176
'li' ,
159
177
{
@@ -165,16 +183,7 @@ class VueBreadcrumbs implements PluginObject<ComponentOptions<Vue>> {
165
183
}
166
184
} ,
167
185
[
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
178
187
]
179
188
)
180
189
}
You can’t perform that action at this time.
0 commit comments