标签: typescript ecmascript-6 typescript-typings
我已将esri传单导入到我的角度组件中。
import * as L from 'leaflet'; declare module 'leaflet' { ... } export = L.esri;
并导入:
import * as L from 'leaflet'; import 'esri-leaflet';
但是在调试时,console.log(L.esri);等于undefined
console.log(L.esri);
undefined
答案 0 :(得分:0)
esri-leaflet的类型文件存在问题。选中here
以克服这种导入esri-leaflet,例如:
esri-leaflet
import * as esri from "esri-leaflet";
,然后像这样访问esri class:
esri class
console.log(esri);
Demo