index.html引入第三方的js文件,使用其中的方法的时候,ESLint直接给我报错了~ 报错如下

'CommonShare' is not defined

步骤

解决的方法其实很简单,请看下面的步骤

编辑.eslintrc.js

在我们的中的module.exports中添加下globals,CommonShare是我们要使用的方法,设置为true即可

globals: {
    CommonShare: true,
  }

重新运行

npm run dev

相关文章:

  • 2021-08-28
  • 2021-08-10
  • 2021-10-16
  • 2021-12-26
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2021-08-04
  • 2021-06-28
  • 2022-12-23
  • 2021-08-07
相关资源
相似解决方案