Tabs component ignore hash option added

This commit is contained in:
Enes Sacid Büker 2023-03-30 16:30:27 +03:00 committed by GitHub
parent 9a6a4a439b
commit f5e28fc634
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 !!}