How to declare global variable in module script

前端 未结 1 1429
情书的邮戳
情书的邮戳 2021-01-23 05:31

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 varia

1条回答
  •  春和景丽
    2021-01-23 05:37

    Instead of var myVar = "my"; use window.myVar = "my";

    0 讨论(0)
提交回复
热议问题