Skip to content

Commit a6d42c9

Browse files
Breadcrumbs: support wire:navigate (#924)
Fix: #922
1 parent 0bf2857 commit a6d42c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/View/Components/Breadcrumbs.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Breadcrumbs extends Component
1717
* @param ?string $textItemClass The classes that should be applied to each item without a link.
1818
* @param ?string $iconClass The classes that should be applied to each items icon.
1919
* @param ?string $separatorClass The classes that should be applied to each separator.
20+
* @param ?bool $noWireNavigate If true, the component will not use wire:navigate on links.
2021
*/
2122
public function __construct(
2223
public ?string $id = null,
@@ -26,6 +27,7 @@ public function __construct(
2627
public ?string $textItemClass = "text-sm",
2728
public ?string $iconClass = "h-4 w-4",
2829
public ?string $separatorClass = "h-3 w-3 mx-1 text-base-content/40",
30+
public ?bool $noWireNavigate = false,
2931
) {
3032
$this->uuid = "mary" . md5(serialize($this)) . $id;
3133
}
@@ -61,7 +63,7 @@ public function render(): View|Closure|string
6163
>
6264
6365
@if ($element['link'] ?? null)
64-
<a href="{{ $element['link'] }}" @class([$linkItemClass])>
66+
<a href="{{ $element['link'] }}" @if(!$noWireNavigate) wire:navigate @endif @class([$linkItemClass])>
6567
@else
6668
<span @class([$textItemClass])>
6769
@endif

0 commit comments

Comments
 (0)