【发布时间】:2021-07-15 06:51:08
【问题描述】:
我在 Symfony 5 中使用 Stimulus,当我在我的 Stimulus 控制器中使用此代码时,PhpStorm 显示错误。
我该如何解决这个问题?
import {Controller} from 'stimulus';
import {index} from "../js/index";
export default class extends Controller{
connect(){
const index1 = index();
}
}
错误:使用了无效函数返回值
我的index() 函数是:
export function index(){
...
}
【问题讨论】:
-
索引是否返回任何内容?如果没有,你可以删除
const index1 =,因为无论如何调用index()时它不会设置任何东西,所以没有什么可以分配
标签: javascript symfony ecmascript-6 phpstorm stimulusjs