feat(frontend): enable Livewire SPA navigation (wire:navigate)
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<h3>分类</h3>
|
||||
<ul>
|
||||
@forelse($categories as $category)
|
||||
<li><a href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a> ({{ $category->post_count }})</li>
|
||||
<li><a wire:navigate href="{{ route('category.show', $category->id) }}">{{ $category->name }}</a> ({{ $category->post_count }})</li>
|
||||
@empty
|
||||
<li>暂无分类</li>
|
||||
@endforelse
|
||||
@@ -22,7 +22,7 @@
|
||||
<h3>最新文章</h3>
|
||||
<ul>
|
||||
@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
|
||||
@@ -33,7 +33,7 @@
|
||||
<h3>最新评论</h3>
|
||||
<ul>
|
||||
@forelse($recentComments as $comment)
|
||||
<li><a href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">{{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 20) }}</a></li>
|
||||
<li><a wire:navigate href="{{ route('posts.show', $comment->post->id) }}#comment-{{ $comment->id }}">{{ $comment->author_name }}:{{ Str::limit(strip_tags($comment->content), 20) }}</a></li>
|
||||
@empty
|
||||
<li>暂无评论</li>
|
||||
@endforelse
|
||||
@@ -44,7 +44,7 @@
|
||||
<h3>标签</h3>
|
||||
<p class="tagcloud">
|
||||
@forelse($hotTags as $tag)
|
||||
<a href="{{ route('tags.show', $tag->name) }}">{{ $tag->name }}</a>
|
||||
<a wire:navigate href="{{ route('tags.show', $tag->name) }}">{{ $tag->name }}</a>
|
||||
@empty
|
||||
暂无标签
|
||||
@endforelse
|
||||
|
||||
Reference in New Issue
Block a user