在Index.ejs中导入全局Scripts
index.ejs:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jointjs/2.1.0/joint.js"></script>
在单独的页面中可以正常使用:
Detail.js
constructor(props) {
super(props);
this.graph = new joint.dia.Graph();
}
但是运行 npm run lint时,报错:
.../Detail.js
30:22 error 'joint' is not defined no-undef
代码检查无法通过