Created
November 15, 2018 14:46
-
-
Save sebastiaanluca/6df7edefaed25d25d076872295b76b17 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
{{--Parent div inherits all unhandled attributes like class, target, … once rendered (so no work for the user)--}} | |
<div> | |
{{--Variable attributes are to be assigned manually--}} | |
<a href="{{ $href }}"> | |
{{ $slot }} | |
</a> | |
</div> | |
// Results in: | |
<div class="tag1 tag2 tag3" target="_blank"> | |
<a href="https://…">Much random</a> | |
</div> |
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
{{--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="{{ $href }}" :attributes="$attributes"> | |
{{ $slot }} | |
</a> | |
</div> | |
// Results in: | |
<div> | |
<a href="https://…" class="tag1 tag2 tag3" target="_blank">Much random</a> | |
</div> |
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
<active-link :href="route('my-route')" class="tag1 tag2 tag3" target="_blank">Much random</active-link> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment