active tab control according to url

This commit is contained in:
Burak Civan 2022-09-28 10:14:43 +03:00
parent 3c0978fad2
commit a8730e6ea3

View File

@ -1,6 +1,6 @@
@props(['active']) @props(['active'])
<div x-data="{ active: '{{ $active }}' }"> <div x-data="{ active: window.location.hash.split('#')[1] == undefined ? '{{ $active }}' : window.location.hash.split('#')[1] }">
<div> <div>
<ul {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'flex items-center']) : $attributes }}> <ul {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'flex items-center']) : $attributes }}>
{!! $navs !!} {!! $navs !!}