可以将Vue Admin(Bulma)包含在Laravel中吗?

时间:2017-01-21 09:59:37

标签: laravel laravel-5.3 vue-component vue.js

我对Vue.js和Js很新。我正在使用Bulma.io CSS Framework并找到了以Bulma样式提供Vue组件的Vue-Admin包。

我想用它,但我不知道如何要求它。我试图要求单个组件,如:

javascript // resource/assets/js/app.js Vue.component('sidebar', require('../../../node_modules/vue-admin/client/components/layout/Sidebar.vue'));

这会在我的控制台中引发以下错误:

ERROR in ./~/vue-admin/client/components/layout/Sidebar.vue
Module not found: Error: Can't resolve 'scss-loader' in '/Volumes/Data/Entwicklung/Workspace/Private/TheNewSumoAndPanda/node_modules/vue-admin/client/components/layout'
 @ ./~/vue-admin/client/components/layout/Sidebar.vue 5:0-169
 @ ./resources/assets/js/app.js

ERROR in ./~/vue-bulma-expanding/src/Expanding.vue
Module not found: Error: Can't resolve 'scss-loader' in '/Volumes/Data/Entwicklung/Workspace/Private/TheNewSumoAndPanda/node_modules/vue-bulma-expanding/src'
 @ ./~/vue-bulma-expanding/src/Expanding.vue 5:0-183
 @ ./~/buble-loader!./~/vue-loader/lib/selector.js?type=script&index=0!./~/vue-admin/client/components/layout/Sidebar.vue
 @ ./~/vue-admin/client/components/layout/Sidebar.vue
 @ ./resources/assets/js/app.js

我还尝试包含某种Autoloader,并尝试了以下内容:

// resource/assets/js/app.js
require('../../../node_modules/vue-admin/client/app');

这引发了以下情况:

ERROR in ./~/vue-admin/client/app.js
Module parse failed: /Volumes/Data/Entwicklung/Workspace/Private/TheNewSumoAndPanda/node_modules/vue-admin/client/app.js Unexpected token (38:2)
You may need an appropriate loader to handle this file type.
|   store,
|   nprogress,
|   ...App
| })
|
 @ ./resources/assets/js/app.js 9:0-53

这是GIthub上的Vue-Admin包的链接:

https://github.com/vue-bulma/vue-admin

我希望你们能帮助我吗?

谢谢大卫

1 个答案:

答案 0 :(得分:0)

我创建了一个没有laravel-mix的集成:https://github.com/gazben/laravel-vue-admin

此解决方案使用原始构建脚本,并且npm命令由artisan命令包装。输出符号链接到相应的目录。