Merge pull request #2954 from EnesSacid-Buker/tab-ignore-hash

Tabs component ignore hash option
This commit is contained in:
Cüneyt Şentürk 2023-03-30 16:38:21 +03:00 committed by GitHub
commit 64f75bb9ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,14 @@
}
@endphp
<div data-swiper="{{ $slides }}" x-data="{ active: window.location.hash.split('#')[1] == undefined ? '{{ $active }}' : window.location.hash.split('#')[1] }">
<div
data-swiper="{{ $slides }}"
@if(! $attributes->has('ignore-hash'))
x-data="{ active: window.location.hash.split('#')[1] == undefined ? '{{ $active }}' : window.location.hash.split('#')[1] }"
@else
x-data="{ active: '{{ $active }}' }"
@endif
>
<div data-tabs-swiper>
<ul data-tabs-swiper-wrapper {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'inline-flex overflow-x-scroll large-overflow-unset']) : $attributes }}>
{!! $navs !!}