我有一个 laravel 组件
<section class="section {{ $classes }}">
<div class="inner">
<h1>{{ $heading }}</h1>
<h2>{{ $subheading }}</h2>
<p>{{ $copy }}</p>
</div>
{{ $slot }}
</section>
我在刀片模板中渲染
@component('components.section', ['classes' => 'lightgrey'])
@slot('heading')
The best thing ever....
@endslot
@slot('subheading')
@endslot
@slot('copy')
Lots of interesting words go here
@endslot
@endcomponent
有时我只有一个H1。如果我没有子标题,如何删除标记?