[Vuejs]-How to set up Laravel 9 project with Vuetify and Vite

0๐Ÿ‘

Do you have your JS and CSS files integrated in your view?

In the head tag put the following line:

 @vite('resources/path/to/app.css') 
 @vite('resources/path/to/app.js') 

Now the vite will be implemented in your view and styles should apply!

0๐Ÿ‘

I found a solution, edit app.js and add lines

import { createApp } from "vue";
import App from "./App.vue";

//add this
import { aliases, mdi } from "vuetify/iconsets/mdi-svg";
//

// Vuetify
import "vuetify/styles";
import { createVuetify } from "vuetify";
import * as components from "vuetify/components";
import * as directives from "vuetify/directives";

const vuetify = createVuetify({
    components,
    directives,

//and this
    icons: {
        defaultSet: "mdi",
        aliases,
        sets: {
            mdi,
        },
    },
//

});

createApp(App).use(vuetify).mount("#app");

Leave a comment