Skip to content

Commit a2b876f

Browse files
authored
Merge pull request #745 from tighten/gc/fixes-once-directive
Adds a snapshot case for the once directive
2 parents e5e4674 + 0b89c1b commit a2b876f

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"michelf/php-markdown": "^2.0",
3636
"mnapoli/front-yaml": "^2.0",
3737
"nunomaduro/collision": "^8.1",
38+
"ramsey/uuid": "^4.9",
3839
"spatie/laravel-ignition": "^2.4",
3940
"symfony/console": "^6.0 || ^7.0",
4041
"symfony/error-handler": "^6.0 || ^7.0",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div>
2+
{{ $slot }}
3+
</div>
4+
5+
@once
6+
<script>
7+
alert('This is the component')
8+
</script>
9+
@endonce
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div>
2+
<p>MAIN LAYOUT</p>
3+
<div>
4+
@yield('body')
5+
</div>
6+
</div>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@extends('_layouts.main')
2+
3+
@section('body')
4+
Hello world!
5+
6+
<x-alert>Slot 1</x-alert>
7+
8+
<x-alert>Slot 2</x-alert>
9+
@endsection
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<div>
2+
<p>MAIN LAYOUT</p>
3+
<div>
4+
Hello world!
5+
6+
<div>
7+
Slot 1
8+
</div>
9+
10+
<script>
11+
alert('This is the component')
12+
</script>
13+
14+
<div>
15+
Slot 2
16+
</div>
17+
18+
</div>
19+
</div>

0 commit comments

Comments
 (0)