File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,18 @@ function itemStyle(item) {
6
6
style += item .url ? " text-gray-700 hover:text-gray-900" : " text-gray-500" ;
7
7
return style ;
8
8
}
9
+
10
+ items .forEach ((item ) => {
11
+ item .tag = item .url ? " a" : " div" ;
12
+ });
9
13
---
10
14
11
15
<nav class =" flex" aria-label =" Breadcrumb" >
12
16
<ol class =" inline-flex items-center space-x-1 md:space-x-2" >
13
17
{
14
18
items .map ((item ) => (
15
19
<li class = " inline-flex items-center" >
16
- <a href = { item .url } class = { itemStyle (item )} >
20
+ <item.tag href = { item .url } class = { itemStyle (item )} >
17
21
{ item .home ? (
18
22
<svg
19
23
aria-hidden = " true"
@@ -40,7 +44,7 @@ function itemStyle(item) {
40
44
</svg >
41
45
)}
42
46
{ item .home ? <span >{ item .label } </span > : <span class = " md:ml-2" >{ item .label } </span >}
43
- </a >
47
+ </item.tag >
44
48
</li >
45
49
))
46
50
}
You can’t perform that action at this time.
0 commit comments