问题
Ts 项目中有 AMap 报错问题
解决问题
d.ts 加入下面的代码
declare interface Window {
WebViewJavascriptBridge: any;
WVJBCallbacks: any;
AMap: any;
init: any;
AMapUI: any;
}
.eslintrc.js 加入下面的代码
globals: {
AMap: true
}, 在 TypeScript 项目中使用高德地图 (AMap) 时,ESLint 报错问题的解决方法:通过在 `d.ts`文件中声明`AMap`接口,并在`.eslintrc.js`中配置全局变量`AMap` 来解决。
Ts 项目中有 AMap 报错问题
d.ts 加入下面的代码
declare interface Window {
WebViewJavascriptBridge: any;
WVJBCallbacks: any;
AMap: any;
init: any;
AMapUI: any;
}
.eslintrc.js 加入下面的代码
globals: {
AMap: true
},