如何在 stackblitz 中包含 javascript url 依赖项?
How to include javascript url dependencies in stackblitz?
我正在尝试 运行 在 stackblitz 中 example 类似的东西。
代码(不是我的,但类似于我想要实现的)运行s 在 js fiddle 中,您可以在其中包含来自 [=] 的 url 的依赖项25=] 但在 stackblitz 项目中尝试相同时不起作用。
我试过像这样在 index.html 中包含依赖项:
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/lib/proj4-compressed.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/src/proj4leaflet.js"></script>
<script src="https://cdn.rawgit.com/MrMufflon/Leaflet.Coordinates/master/dist/Leaflet.Coordinates-0.1.5.min.js"></script>
我也尝试了一些动态加载代码片段,但我总是以
L is not defined
在页面中添加脚本标签 <head>
标签
<head>
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/lib/proj4-compressed.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/src/proj4leaflet.js"></script>
<script src="https://cdn.rawgit.com/MrMufflon/Leaflet.Coordinates/master/dist/Leaflet.Coordinates-0.1.5.min.js"></script>
</head>
<div id="app"></div>
<div id="map"></div>
我正在尝试 运行 在 stackblitz 中 example 类似的东西。
代码(不是我的,但类似于我想要实现的)运行s 在 js fiddle 中,您可以在其中包含来自 [=] 的 url 的依赖项25=] 但在 stackblitz 项目中尝试相同时不起作用。
我试过像这样在 index.html 中包含依赖项:
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/lib/proj4-compressed.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/src/proj4leaflet.js"></script>
<script src="https://cdn.rawgit.com/MrMufflon/Leaflet.Coordinates/master/dist/Leaflet.Coordinates-0.1.5.min.js"></script>
我也尝试了一些动态加载代码片段,但我总是以
L is not defined
在页面中添加脚本标签 <head>
标签
<head>
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/lib/proj4-compressed.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/src/proj4leaflet.js"></script>
<script src="https://cdn.rawgit.com/MrMufflon/Leaflet.Coordinates/master/dist/Leaflet.Coordinates-0.1.5.min.js"></script>
</head>
<div id="app"></div>
<div id="map"></div>