Skip to content

Instantly share code, notes, and snippets.

@sebastiaanluca
Created November 15, 2018 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastiaanluca/f4b15e9f1a363108e60c748dc7111c3b to your computer and use it in GitHub Desktop.
Save sebastiaanluca/f4b15e9f1a363108e60c748dc7111c3b to your computer and use it in GitHub Desktop.
{{--myRandomView.blade.php--}}
<active-link :href="route('my-route')" class="tag1 tag2 tag3" target="_blank">Much random</active-link>
{{--activeLink.blade.php option 1--}}
{{--Parent div inherits all unhandled attributes like class, target, … once rendered (so no work for the user)--}}
{{--<div class="tag1 tag2 tag3" target="_blank">--}}
<div>
{{--Variable attributes are to be assigned manually--}}
<a href="{{ $href }}">
{{ $slot }}
</a>
</div>
{{--activeLink.blade.php option 2--}}
{{--Parent div stays clean, attributes aren't added automatically--}}
<div>
{{--Manually assign unhandled attributes to a tag (can be any tag in the view, and even multiple)--}}
{{--<a href="https://…" class="tag1 tag2 tag3" target="_blank">--}}
<a href="{{ $href }}" :attributes="$attributes">
{{ $slot }}
</a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment