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.
Instead of var myVar = "my";
use window.myVar = "my";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.