我正在看一个使用laravel和vue的教程,在教程中,他在components文件夹中添加了一个vue组件,然后使用以下代码在app.js文件中注册该组件
Vue.component('articles',require('./components/articles.vue');
它工作得很好,在我的例子中,当我使用这段代码时,它说是require is not defined。在app.js文件中,已经有一个使用以下代码注册的示例组件
Vue.component('example-component',__webpack_require__(
我运行过npm运行监视并收到了消息
This dependency was not found:
* in ./resources/assets/js/app.js
To install it, you can run: npm install --save
所以我运行npm安装-保存,但仍然得到相同的信息。
据我所知,我需要npm运行或npm运行手表加载Vue文件在Laravel。
例如,在‘resources/assets/js/components/ example e.vue’文件中,我对其进行了编辑,但是当我加载‘resources/view/pope.blde.php’文件
我已经从我的Laravel项目url中删除了public。但是现在我的Vue.js坏了。
如果我从src文件中删除public,它不会识别出项目有Vue.js,但如果我添加public,它就会识别出这个项目有Vue.js。但是它没有在我的Blade页面上显示该组件,而是给出了这个错误:
[Vue warn]: Unknown custom element: <app-some> - did you register the component correctly? For recursive components, make sure to provide the "nam