What seems to be the problem:i Cant quit figure out how to set up turbolinks with livewire,
i am sorry in advance if this isn’t how it should be .i am new to livewire/turbolinks .Thank you!
Steps to Reproduce:
Are you using the latest version of Livewire:yes
Do you have any screenshots or code examples:
in:app.blade.php
<script src="{{ asset('js/app.js') }}" defer data-turbolinks-track="true"></script>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.js" defer></script>
<!-- Styles -->
<link href="{{mix('css/app.css')}}" rel="stylesheet" data-turbolinks-track="true">
@livewireStyles
app.js
-var Turbolinks = require(“turbolinks”)
-Turbolinks.start()
-$(document).on(‘turbolinks:load’, function (){
window.livewire.rescan() })
routes
Route::livewire(‘findByTag/{tag}’, ‘issues-content-component’)->name(‘find.tag’);
route calls:
<a data-turbolinks="true" href="{{route('find.tag', ['tag'=>1]) }}" class="flex justify-between items-center px-3 py-2 focus:bg-gray-400 hover:bg-gray-200 rounded-lg">
<span class="text-sm font-medium text-gray-900"> All </span>
<span class="text-xs font-semibold text-gray-700">36</span>
</a>
<a data-turbolinks="true" href="{{route('find.tag', ['tag'=>2]) }}" class="flex justify-between items-center px-3 py-2 focus:bg-gray-400 hover:bg-gray-200 rounded-lg">
<span class="text-sm font-medium text-gray-900"> Asigned to me</span>
<span class="text-xs font-semibold text-gray-700">36</span>
</a>