我如何将传单螺旋式Ecorator与VUE应用程序一起使用
我有一个vue 2示例项目,位于 https://github.com/ericg-vue-vue-vue-com-问题/传单测试
我尝试过的几件事是修改代码做:
<script>
import "leaflet/dist/leaflet.css";
import L from "leaflet";
import * from 'leaflet-polylinedecorator';
但是这导致构建错误:
10:9 error Parsing error: Unexpected token, expected "as"
> 4 | import * from 'leaflet-polylinedecorator';
index.html ,我也尝试添加:
<script src="../node_modules/leaflet-polylinedecorator/dist/leaflet.polylineDecorator.js"></script>
但这导致运行时错误:
Uncaught SyntaxError: Unexpected token '<' (at leaflet.polylineDecorator.js:1:1)
需要更改什么,以便我可以使用VUE应用程序导入并使用此传单扩展名?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现的一种解决方案是修改 main.js 因此,看起来:
添加
需要
解决了问题。如果有的话,我会对替代解决方案感兴趣。
A solution I found was to modify main.js so it looks like:
Adding the
require
resolved the problem.I would be interested in alternative solutions, if there are any.