Vuetify未在Laravel中应用 [英] Vuetify not being applied in Laravel
本文介绍了Vuetify未在Laravel中应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Laravel项目中安装了Vuetify,但所有v-类都无法正常工作.控制台中没有错误.这是app.js文件:
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
});
以及未应用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.
推荐答案
创建Vue距离时,还必须创建一个新的Vuetify距离.
When you create your Vue istance you must create a new istance of Vuetify also.
const app = new Vue({
el: '#app',
vuetify: new Vuetify()
});
我建议您在导入Vuetify之后也添加它:
I suggest you also to add this after importing Vuetify:
import 'vuetify/dist/vuetify.min.css'
这篇关于Vuetify未在Laravel中应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文