laravel - laravel中vue的问题
问题描述
我正在尝试在我的 laravel 5.8 项目中实施 媒体管理器 3.6.7,但我遇到了 VUE 问题。(这是我第一次使用它)。
在控制台中,它给了我两个错误:空白页面的控制台错误,但是当我单击页面源时,我可以看到页面已呈现:页面源
我想我被困在这个:
// app.js
window.Vue = require('vue')
require('../assets/vendor/MediaManager/js/manager')
new Vue({
el: '#app'
})
我应该把它放在哪里?如果我把它放在 media.blade.php 我得到 Require is not a function。如果我包括要求,还有另一个错误
Module name "vue" has not been loaded yet for context: _. Use require([])
如果我使用 require(['vue']) 我得到了 20 个错误..
这里有什么问题?前面的步骤已成功完成。
解决方案
该错误清楚地表明您没有正确注册该组件。
在 app.js 文件中:
import ComponentA from '/*path of the file*/'
import ComponentB from '/*path of the file*/'
new Vue({
el: '#app',
components: {
'my-notification': ComponentA,
'media-manager': ComponentB
}
})
推荐阅读
- javascript - 多级引导导航栏:不能悬停在子元素上
- c++ - 对部分特化无效使用不完整类型
- css - 响应式网页在 Firefox 的开发模式下工作,但在我的 S9 Firefox 上却不行
- python-3.x - 如何为迭代 postOrder 遍历复制树以保护树
- regex - Laravel - 正则表达式路由匹配所有内容,但不完全匹配一个或多个单词
- python - 调用时出现 Python 描述符属性问题
- python - Pandas pd.Grouper 的 sum() 问题
- visual-studio - CMake 错误:无法创建命名生成器 Visual Studio 15 2017(运行英特尔 openVINO 工具包的验证脚本时)
- mysql - 没有笛卡尔积的 INNER JOIN 的替代方案
- linux - 是否可以获取现在正在执行的命令参数?