Skip to content

Commit 9c454b4

Browse files
committed
Allow configurations for btn class.
1 parent 5f24bf8 commit 9c454b4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Livewire/ExportButtonComponent.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
namespace Yajra\DataTables\Livewire;
44

5+
use Illuminate\Database\Eloquent\Concerns\HasAttributes;
56
use Illuminate\Support\Facades\Bus;
67
use Illuminate\Support\Facades\Storage;
78
use Livewire\Component;
89

910
class ExportButtonComponent extends Component
1011
{
12+
public $class = 'btn btn-primary';
1113
public $tableId;
1214
public $type = 'csv';
1315
public $filename = null;
@@ -54,9 +56,6 @@ public function render()
5456
return view('datatables-export::export-button');
5557
}
5658

57-
/**
58-
* @return string
59-
*/
6059
protected function getType(): string
6160
{
6261
return $this->type == 'csv' ? 'csv' : 'xlsx';

src/resources/views/export-button.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<button type="submit"
1616
x-ref="exportBtn"
1717
:disabled="$wire.exporting"
18-
class="btn btn-primary"
18+
class="{{ $class }}"
1919
>Export</button>
2020
</form>
2121

0 commit comments

Comments
 (0)