feat(frontend): enable Livewire SPA navigation (wire:navigate)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<ul class="widget-list">
|
||||
@forelse($categories as $category)
|
||||
<li>
|
||||
<a href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a>
|
||||
<a wire:navigate href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a>
|
||||
<span class="count">({{ $category->post_count }})</span>
|
||||
</li>
|
||||
@empty
|
||||
@@ -18,7 +18,7 @@
|
||||
<h3 class="widget-title">最新文章</h3>
|
||||
<ul class="widget-list">
|
||||
@forelse($recentPosts as $post)
|
||||
<li><a href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a></li>
|
||||
<li><a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a></li>
|
||||
@empty
|
||||
<li>暂无文章</li>
|
||||
@endforelse
|
||||
@@ -30,7 +30,7 @@
|
||||
<ul class="widget-list">
|
||||
@forelse($recentComments as $comment)
|
||||
<li>
|
||||
<a href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">
|
||||
<a wire:navigate href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">
|
||||
{{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 30) }}
|
||||
</a>
|
||||
</li>
|
||||
@@ -44,7 +44,7 @@
|
||||
<h3 class="widget-title">标签云</h3>
|
||||
<div class="tag-cloud">
|
||||
@forelse($hotTags as $tag)
|
||||
<a href="{{ route('tags.show', $tag->name) }}" class="tag-link">{{ $tag->name }}</a>
|
||||
<a wire:navigate href="{{ route('tags.show', $tag->name) }}" class="tag-link">{{ $tag->name }}</a>
|
||||
@empty
|
||||
<span>暂无标签</span>
|
||||
@endforelse
|
||||
|
||||
Reference in New Issue
Block a user