如何设置 class 和内联样式到 laravel blade 组件?

How to set class and inline style to laravel blade component?

我在 laravel blade 中有一个组件,我想在不传递任何数据的情况下为组件设置 class 或内联样式,但我的代码无法正常工作 mt-5 未设置为 x.atom.form 组件。 我的简单代码是:

<x-atom.form class="mt-5" :data="$fields->main_form"></x-atom.form>

ِ你假设我的组件代码是:

<section class="contact-form"></section>

resources\views\components\atom\form.blade.php

<section {{ $attributes->merge(['class' => 'contact-form']) }}>
   {{-- ... --}}
   {{-- ...  --}}
</section>

some_file.blade.php

<x-atom.form class="mt-5"></x-atom.form>

docs ref