Index.ejs中导入全局Scripts, 单独的页面中引用,运行lint 报undefined

新手上路,请多包涵

在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

代码检查无法通过

阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进