[Vuejs]-JS File using laravel inertia.js with vue.js3 template not working

0๐Ÿ‘

I have solution to this, so rather than adding the js and css in the app.blade.php file, move asset folder resources folder.

Import the all css file in app.css like as

//resources/css/app.css
@import '../assets/css/dashlite.css?ver=3.1.1';
@import '../assets/css/theme.css?ver=3.1.1';

same import the all js file in app.js like as

//resources/js/app.js
import("../assets/libs/jsvectormap/js/jsvectormap.min.js");
import("../assets/libs/jsvectormap/maps/world-merc.js");
import("../assets/libs/jsvectormap/maps/world-merc.js");

Now in app.blade.php add css and js inside the vite directive

 @vite(['resources/js/app.js', 'resources/css/app.css', 
 "resources/js/Pages/{$page['component']}.vue"])

May this will help you. Happy coding

-1๐Ÿ‘

Try Vuejs themes. I was having same problem, but I changed to Vueja themes, try admin one inertia theme

Leave a comment