File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,34 @@ use App\Http\Controllers\UsersController;
196196Route::get('/users', [UsersController::class, 'index'])->name('users.index');
197197```
198198
199+ ### Use ViteJs / script type defaults to module
200+
201+ You can also set DataTable to use vitejs by default by registering ` Builder::useVite() ` inside the ` AppServiceProvider ` .
202+
203+ ``` php
204+ namespace App\Providers;
205+
206+ use Illuminate\Support\ServiceProvider;
207+ use Yajra\DataTables\Html\Builder;
208+
209+ class AppServiceProvider extends ServiceProvider
210+ {
211+ public function boot(): void
212+ {
213+ Builder::useVite();
214+ }
215+ }
216+ ```
217+
218+ Upon registering, you can now use scripts and without the need to set the type to module.
219+
220+ ``` php
221+ @push('scripts')
222+ {{ $dataTable->scripts() }}
223+ @endpush
224+ ```
225+
226+
199227<a name =" update-default-layout " ></a >
200228## <b >05.</b > Update the default app layout
201229
You can’t perform that action at this time.
0 commit comments