1.通过在.eslintrc.js中配置如下,只要配置一个,亲测有效,没有.eslintrc.js文件的,可以npm安装一下(默认依赖中有),然后
eslint --init
就可以出现文件,
在文件中:
"globals": {
"AMap": "true",
"AMapUI":"true",
},
2.在每一个使用中配置,每一个使用到的都要配置:
// eslint-disable-next-line no-undef
gaodesatellite: new AMap.TileLayer.Satellite()
3.在某一个使用中配置,应该一个文件只需要一次
/* global AMap*/
gaodesatellite: new AMap.TileLayer.Satellite()
网上所说的配置
script 标签没有效果