Skip to content
Advertisement

Is the other way to use Vue component in Laravel?

I have a Laravel project and I would like to integrate Vue. I’m not getting any error bu the Vue components just not loading up. I guess I’m making somekind of logical mistake if I’m not getting an error.

index.blade.php:

JavaScript

App.js:

JavaScript

routes.js:

JavaScript

audit/index.vue:

JavaScript

Advertisement

Answer

Have you added configuration in the webpack file for Vue components? Refer Laravel Mix Vue

The laravel team has a laravel/ui package which comes with scaffolding using Vue: laravel/ui package. Add the package and scaffold it for Vue.

JavaScript

This approach is better than trying to set everything up yourself as it also comes with a script which allows you to automatically register Vue components

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement