Vue uses AutoNavi map error’AMapUI’ is not defined,’AMap’ is not defined problems and solutions.

After introducing the AutoNavi map in index.html, it reported the error’AMapUI’ is not defined,’AMap’ is not defined’

First, I tried to put the reference of the Gaode map in the body and found that it was useless, and then found out that the configuration in .eslintrc.js is as follows

"globals": {
    "AMap": "true",
    "AMapUI":"true",
},

If there is no .eslintrc.js file, install it first

eslint --init

Leave a Reply