-
我的项目环境是vue3,项目是用的vite作为包管理工具,也作为启动引擎,但是启动后打开地图报“ReferenceError: global is not defined”这个错误,如果用vue-cli则没问题,请问有没有解决的办法?不胜感激! |
Beta Was this translation helpful? Give feedback.
Answered by
zouyaoji
Sep 16, 2021
Replies: 1 comment
-
@hkhenan 下次可以@我,才看到这个。 main.ts
main.js
index.html <body>
<div id="app"></div>
<script>
var global = globalThis
</script>
<script type="module" src="/src/main.js"></script>
</body> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zouyaoji
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hkhenan 下次可以@我,才看到这个。
这个是正常的一般是在main.js或者index.html加一句:
main.ts
main.js
index.html