问题
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