These days, many applications are built as single-page applications (SPA). Livewire v3 offers a single-page application experience.
Basic Usage
To use this feature, you just need to add a wire:navigate
directive to the navigation link. For example, if we have a couple of routes.
Route::get('posts', \App\Livewire\ShowPosts::class);Route::get('posts/create', \App\Livewire\CreatePost::class);Route::get('users', \App\Livewire\ShowUsers::class);
Then we add wire:navigate
to each link.
<nav> <a href="/posts" wire:navigate>Posts</a> <a href="/posts/create" wire:navigate>Create Post</a> <a href="/users" wire:navigate>Users</a></nav>
After clicking a link, Livewire will load the new page in the background, and only then will...