Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #83 from Gummibeer/patch-1
Browse files Browse the repository at this point in the history
add comments and result
  • Loading branch information
Rias authored Aug 16, 2019
2 parents ccf2847 + 987fdef commit 7f604eb
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions docs/basic-usage/using-slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BladeX support slots too. This layout component
{{ $sidebar }}
</div>
<div class="w-2/3">
{{ $slot }}
{!! $slot !!}
</div>
</div>
<footer>
Expand All @@ -29,15 +29,40 @@ can be used in your views like this:

```html
<layout title="Zed's chopper">
<!-- is available as $sidebar - the name is used as variable name -->
<slot name="sidebar">
<ul>
<li>Home</li>
<li>Contact</li>
</ul>
</slot>

<!-- everything else inside a component is available as $slot -->
<main class="content">Whose motorcycle is this?</main>

<!-- is available as $footer - the name is used as variable name -->
<slot name="footer">It's not a motorcycle honey, it's a chopper.</slot>
</layout>
```
```

and will result in:

```html
<div>
<h1>Zed's chopper</h1>
<div class="flex">
<div class="w-1/3">
<ul>
<li>Home</li>
<li>Contact</li>
</ul>
</div>
<div class="w-2/3">
<main class="content">Whose motorcycle is this?</main>
</div>
</div>
<footer>
It's not a motorcycle honey, it's a chopper.
</footer>
</div>
```

0 comments on commit 7f604eb

Please sign in to comment.