【发布时间】:2017-06-06 06:54:25
【问题描述】:
总的来说,我对 Vue.js 和 Js 还是很陌生。我正在使用 Bulma.io CSS 框架并找到了 Vue-Admin 包,它提供了 Bulma 样式的 Vue 组件。
我想使用它,但我不知道如何要求它。我试图要求一个像这样的组件:
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
我希望你们能帮助我吗?
谢谢大卫
【问题讨论】:
标签: laravel laravel-5.3 vue-component vue.js