Postingan lainnya
Drowdown Livewire tidak bisa berjalan saat menggunakan turbolink
Saya belajar projek laravel livewire dengan turbolink agar SPA.
saat turbolink saya aktifkan (terpasang) dropdown menjadi tidak bisa berjalan (saat diklik tidak bisa terbuka)
harus di full refresh halaman baru bisa berjalan normal.
@livewireScripts
<!-- TURBOLINKS -->
<script type="module">
import hotwiredTurbo from 'https://cdn.skypack.dev/@hotwired/turbo';
</script>
<script src="{{ asset('assets/js/turbolinks.js') }}" data-turbolinks-eval="false" data-turbo-eval="false"></script>
<div class="navbar-right fo ">
<ul class="nav navbar-nav">
<li class="">
{{-- {{$jadwalId}} --}}
<button class="btn btn-sm btn-{{ $jadwalUsed!=null ? 'info' : 'secondary' }}">
@if ($jadwalUsed!=null)
{{ $jadwalUsed->tahapan }} ({{ $jadwalUsed->uraian }}) - {{ $jadwalUsed->tahun->tahun }}
@else
Tidak ada Jadwal yang Aktif
@endif
</button>
</li>
<li class="right-sidebar-in right-sidebar-2-menu">
<i class="mdi mdi-settings mdi-spin"></i>
</li>
<!-- User Account -->
<li class="dropdown user-menu">
<button href="#" class="dropdown-toggle nav-link" data-toggle="dropdown">
<img class="user-image" src="{{ asset('assets/img/skh.png') }}"
alt="{{ Auth::user()->name }}" />
<span class="d-none d-lg-inline-block">Hi, {{ Auth::user()->name }}</span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<!-- User image -->
<li class="dropdown-header">
<img class="h-10 w-10 rounded-full object-cover"
src="{{ Auth::user()->profile_photo_url }}" alt="{{ Auth::user()->name }}" />
<div class="d-inline-block">
{{ Auth::user()->name }}
</div>
</li>
<li class="dropdown-body">
{{-- <a href="#"><i class="mdi mdi-face"></i>Profile</a> --}}
<a href="#"><i class="mdi mdi-textbox-password"></i>Ubah Password</a>
<form method="POST" action="{{ route('logout') }}">
@csrf
<a href="{{ route('logout') }}" onclick="event.preventDefault();
this.closest('form').submit();"> <i class="mdi mdi-logout"></i> Logout </a>
</form>
</li>
</ul>
</li>
</ul>
</div>
ada yang pernah mengalami ? mohon bantuannya
0
1 Jawaban:
<div>Coba ganti scriptnya jadi kayak gini<br><br></div><pre>@livewireScripts <script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks@v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false"></script> </pre>
0