Closed Pindagus closed 2 years ago
button.twig:
<button {{ attributes.merge({ class: 'defaultClass' }) }}>{{ slot }}</button>
button/red.twig:
<x-button {{ attributes.merge({ class: 'bg-red-500' }) }}>{{ slot }}</x-button>
With the templates above the usage of <x-button.red class="mb-5">Click me</x-button.red> would fail. Some changes to the regex in ComponentTagCompiler fixes that.
<x-button.red class="mb-5">Click me</x-button.red>
ComponentTagCompiler
Nice!
button.twig:
button/red.twig:
With the templates above the usage of
<x-button.red class="mb-5">Click me</x-button.red>
would fail. Some changes to the regex inComponentTagCompiler
fixes that.