Dropdown link component target attribute added
This commit is contained in:
parent
48d9e7fd64
commit
a2f882a36e
@ -7,6 +7,7 @@ use App\Abstracts\View\Component;
|
|||||||
class Link extends Component
|
class Link extends Component
|
||||||
{
|
{
|
||||||
public $href;
|
public $href;
|
||||||
|
public $target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new component instance.
|
* Create a new component instance.
|
||||||
@ -14,9 +15,10 @@ class Link extends Component
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
$href = '',
|
string $href = '', string $target = '_self'
|
||||||
) {
|
) {
|
||||||
$this->href = $href;
|
$this->href = $href;
|
||||||
|
$this->target = $target;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap" {{ $attributes }}>
|
<div class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap" {{ $attributes }}>
|
||||||
<a href="{!! $href !!}" class="w-full h-full flex items-center rounded-md px-2 text-sm font-normal hover:bg-lilac-100">
|
<a href="{!! $href !!}" target="{!! $target !!}" class="w-full h-full flex items-center rounded-md px-2 text-sm font-normal hover:bg-lilac-100">
|
||||||
{!! $slot !!}
|
{!! $slot !!}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user