前言
在index.html引入第三方的js文件,使用其中的方法的时候,ESLint直接给我报错了~ 报错如下
'CommonShare' is not defined
步骤
解决的方法其实很简单,请看下面的步骤
编辑.eslintrc.js
在我们的中的module.exports中添加下globals,CommonShare是我们要使用的方法,设置为true即可
globals: { CommonShare: true, }
重新运行
npm run dev
学无止境,谦卑而行.