前言
在index.html
引入第三方的js文件,使用其中的方法的時候,ESLint直接給我報錯了~ 報錯如下
'CommonShare' is not defined
步驟
解決的方法其實很簡單,請看下面的步驟
編輯.eslintrc.js
在我們的中的module.exports
中添加下globals
,CommonShare
是我們要使用的方法,設置為true
即可
globals: {
CommonShare: true,
}
重新運行
npm run dev