php storm vue 组件不工作/未解析的函数或方法组件

php storm vue component doesnt work / unresoved function or method component

我几天前就遇到了这个问题,我真的在互联网上找不到任何解决方案。

我是新手 Vue.js

我正在从事 TDD laravel 项目:

现在我想像这样将标准 vue 示例组件添加到我的 app.blade.php 中:

app.blade.php

<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>

<body>
<div id="app">
    <example-component></example-component>
</div>

app.js

require('./bootstrap');

window.Vue = require('vue');

Vue.component('example-component', require('./components/ExampleComponent.vue').default);

const app = new Vue({
    el: '#app',
});

结果示例组件在网页上呈现...没问题...

但是问题来了:

一旦我更改示例组件中的任何 HTML 代码,它就不会在浏览器中显示更改。它一直显示标准示例组件。

更糟糕的是:

当我通过重构为 FlashTest.vue(例如或其他任何东西)重命名 examplecomponent.vue 文件并像这样更改 app.layout.blade 和 app.js 时:

<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>

<body>
<div id="app">
    <flash-test></flash-test>
</div>

app.js

require('./bootstrap');

window.Vue = require('vue');

Vue.component('flash-test', require('./components/FlashTest.vue').default);

const app = new Vue({
    el: '#app',
});

我看不到那个组件。

我收到的唯一错误消息是当我想注册任何全局组件时来自控制台:

app.js:37935 [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

(found in )app.js:37935 [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

(found in )

我得到的另一个错误来自 php 风暴:

在我注册组件的行旁边:

´´´ Vue.component('example-component', require('./components/ExampleComponent.vue').default); ´´´

它震动:

unresolved function or method component check that called functions are valid

请帮助我,我已经尝试了 2 天以来的一切

1)首先你需要下载 node.js 和 npm : https://nodejs.org/en/

2)你需要安装npm。 运行 在项目根目录中

npm install

3)您必须使用 npm 构建 app.js 脚本。 运行 在项目根目录中

npm run dev