Created
November 15, 2018 14:41
-
-
Save sebastiaanluca/f4b15e9f1a363108e60c748dc7111c3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{--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