【发布时间】:2020-05-11 13:51:11
【问题描述】:
我正在尝试在我的 laravel 项目中使用 Vue。 并为该项目导入 vuetify。
但它会将所有 css 内联附加到项目中。
我的 app.js 是 avobe:
window.Vue = require('vue');
//import Vuetify from 'vuetify'
import VueRouter from 'vue-router'
import {store} from './store/store'
import vuetify from './plugins/vuetify' // path to vuetify export
import 'vuetify/dist/vuetify.min.css' // Ensure you are using css-loader
import Master from './Master'
import router from './router'
Vue.use(VueRouter)
Vue.config.productionTip = false;
router.beforeEach((to, from, next) => {
if(to.matched.some(record => record.meta.requiresAuth)){
if(store.getters.loggedIn){
next()
}else{
next({name: 'login'})
}
}else{
if(store.getters.loggedIn){
next({name: 'dashboard'})
}else{
next()
}
}
})
// use the plugin
const app = new Vue({
el: '#app',
router: router,
store: store,
vuetify,
components: {Master},
template: "<Master />"
});
我的 webpack.mix.js:
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
以下是代码如何自行编译:
如何在“blabla.css”文件中使用 vuetify 代码?
【问题讨论】:
-
在 blabla.css 中使用 vuetify 代码是什么意思?
-
我只想编译文件中的所有css,而不是内联html。
标签: laravel vue.js laravel-mix