Extending Button class with icon #1413
Unanswered
eafarooqi
asked this question in
Documentation
Replies: 2 comments
-
Sometimes it can be more complicated. I need to find a way to document this. Can you take a look at this example? |
Beta Was this translation helpful? Give feedback.
0 replies
-
With this examples it works! @eafarooqi keep in mind that macro method MUST be put AFTER I was able to add Datatables: public function actions($row): array
{
return [
Button::add('show')
->slot('Show')
->wire() // <--- HERE
->class('bg-indigo-500 text-white')
->route('balance.show', [
'balance' => $row->id,
])
->target('_self'),
];
} AppServiceProvider: public function boot(): void
{
....
Button::macro('wire', function () {
$this->dynamicProperties['wire'] = [
'component' => 'a wire:navigate',
];
return $this;
});
} It was rendered as: <div wire:key="action-21-render-action.0.show">
<a wire:navigate target="_self" class="bg-indigo-500 text-white" href="https://localhost/balance/21">Show</a>
</div> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Have you searched through other issues to see if your problem is already reported or has been fixed?
Yes, I did not find it.
Did you read the documentation?
Yes, I did not find it.
Have you tried to publish the views?
Yes - I didn't work.
Is there an error in the console?
No
PHP Version
8.1.0
PowerGrid
5.0.3
Laravel
10.23.1
Livewire
3.0.3
Alpine JS
No response
Theme
Bootstrap
Describe the bug.
Extending the button class as per documentation change anchor tag to button and then href will not work on button and also how to add the dynamic property to the action like font Awesome icon. There is no detail like V4.
To Reproduce...
AppServiceProvider boot function
Table actions.
This will result in the following html
now the click will not work. As href on button has no affect and also how can we add the icon to the rendering html. There is no information about this in the documentation.
Extra information
Beta Was this translation helpful? Give feedback.
All reactions