问题
I have a module script, in which I import some classes and initialize my app. But module scipts declare var myVar = "my";
in module context, what makes init variables unaccessible to main app code. But I don't know how to declare global variable in module script.
回答1:
Instead of var myVar = "my";
use window.myVar = "my";
来源:https://stackoverflow.com/questions/48612021/how-to-declare-global-variable-in-module-script