Vuetify not being applied in Laravel

泄露秘密 提交于 2020-01-25 08:19:06

问题


I have Vuetify installed in my Laravel project but none of the v- classes are working. There are no errors in the console though. Here is the app.js file:

require('./bootstrap');

window.Vue = require('vue');

import Vuetify from 'vuetify'

Vue.use(Vuetify);

Vue.component('container-component', require('./components/ContainerComponent.vue').default);
Vue.component('index-component', require('./components/IndexComponent.vue').default);

const vuetify = new Vuetify();

const app = new Vue({
    el: '#app',
    vuetify
});

and an example component which vuetify isn't being applied to:

<template>
    <v-btn>BUTTON</v-btn>
</template>

<script>
    export default {
        name: "IndexComponent"
    }
</script>

<style scoped>

</style>

I just was using a single button to test if it was working.


回答1:


When you create your Vue istance you must create a new istance of Vuetify also.

const app = new Vue({
    el: '#app',
    vuetify: new Vuetify()
});

I suggest you also to add this after importing Vuetify:

import 'vuetify/dist/vuetify.min.css'



来源:https://stackoverflow.com/questions/59073551/vuetify-not-being-applied-in-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!