feat(frontend): enable Livewire SPA navigation (wire:navigate)
This commit is contained in:
@@ -6,19 +6,19 @@
|
||||
@endphp
|
||||
<article class="post-card {{ $post->isPinned() ? 'sticky' : '' }} post-card-{{ $viewMode }}">
|
||||
@if($url = $post->coverImageUrl())
|
||||
<a href="{{ route('posts.show', $post->id) }}" class="post-cover">
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}" class="post-cover">
|
||||
<img src="{{ $url }}" alt="{{ $post->title }}" loading="lazy">
|
||||
</a>
|
||||
@endif
|
||||
<h2 class="post-title">
|
||||
@if($label = $post->stickyLabel())<span class="badge">{{ $label }}</span>@endif
|
||||
<a href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a>
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}">{{ $post->title }}</a>
|
||||
</h2>
|
||||
<div class="post-meta">
|
||||
<time datetime="{{ $post->published_at->toIso8601String() }}">{{ $post->published_at->format(blog_setting('normaltime', 'Y-m-d H:i')) }}</time>
|
||||
@if($post->category)
|
||||
<span>·</span>
|
||||
<a href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a>
|
||||
<a wire:navigate href="{{ route('category.show', $post->category->id) }}">{{ $post->category->name }}</a>
|
||||
@endif
|
||||
<span>· 阅读 {{ $post->views }}</span>
|
||||
<span>· 评论 {{ $post->comment_count }}</span>
|
||||
@@ -33,9 +33,9 @@
|
||||
</div>
|
||||
@endif
|
||||
<div class="post-footer">
|
||||
<a href="{{ route('posts.show', $post->id) }}" class="read-more">阅读全文 »</a>
|
||||
<a wire:navigate href="{{ route('posts.show', $post->id) }}" class="read-more">阅读全文 »</a>
|
||||
@foreach($post->tags 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>
|
||||
@endforeach
|
||||
</div>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user