mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
feat: 兼容引入某个库导致 global is not defined
报错
This commit is contained in:
parent
cadd611559
commit
641355083c
7
src/utils/globalPolyfills.ts
Normal file
7
src/utils/globalPolyfills.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// 如果项目出现 `global is not defined` 报错,可能是您引入某个库的问题,比如 aws-sdk-js https://github.com/aws/aws-sdk-js
|
||||||
|
// 解决办法就是将该文件引入 src/main.ts 即可 import "@/utils/globalPolyfills";
|
||||||
|
if (typeof (window as any).global === "undefined") {
|
||||||
|
(window as any).global = window;
|
||||||
|
}
|
||||||
|
|
||||||
|
export {};
|
Loading…
x
Reference in New Issue
Block a user