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:
parent
90210225d7
commit
65beeb1487
1 changed files with 3 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
@props(['href' => false, 'type' => 'default'])
|
@props(['href' => false, 'type' => 'default', 'element' => false])
|
||||||
|
|
||||||
@php
|
@php
|
||||||
|
|
||||||
|
|
@ -22,6 +22,8 @@ default:
|
||||||
if ($href) {
|
if ($href) {
|
||||||
$element = 'a';
|
$element = 'a';
|
||||||
$attributes = $attributes->merge([ 'href' => $href ]);
|
$attributes = $attributes->merge([ 'href' => $href ]);
|
||||||
|
} else if ($element == 'input') {
|
||||||
|
$attributes = $attributes->merge([ 'type' => 'submit' ]);
|
||||||
} else {
|
} else {
|
||||||
$element = 'button';
|
$element = 'button';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue