Archived
1
0
Fork 0

resources/views/components/button.blade.php: bit of a hack, but add "element" prop and when it's "input" switch type to submit.

This commit is contained in:
Henrik Hautakoski 2021-12-31 16:53:05 +01:00
parent 90210225d7
commit 65beeb1487

View file

@ -1,4 +1,4 @@
@props(['href' => false, 'type' => 'default'])
@props(['href' => false, 'type' => 'default', 'element' => false])
@php
@ -22,6 +22,8 @@ default:
if ($href) {
$element = 'a';
$attributes = $attributes->merge([ 'href' => $href ]);
} else if ($element == 'input') {
$attributes = $attributes->merge([ 'type' => 'submit' ]);
} else {
$element = 'button';
}