在index.html引入第三方的js文件,使用其中的方法的时候,ESLint直接给我报错了~ 报错如下
index.html
'CommonShare' is not defined
解决的方法其实很简单,请看下面的步骤
在我们的中的module.exports中添加下globals,CommonShare是我们要使用的方法,设置为true即可
module.exports
globals
CommonShare
true
globals: { CommonShare: true, }
npm run dev
本文分享自 作者个人站点/博客 前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!