TomVista
V2EX  ›  问与答

严格模式下如何对 window 添加属性或方法

  •  
  •   TomVista · Feb 21, 2019 · 1123 views
    This topic created in 2719 days ago, the information mentioned may be changed or developed.

    今天捡起来 webpack,顺便开始使用严格模式,发现严格模式下无法对 window 添加属性或方法.

    我想在 webpack 中暴露函数,作为 Html 页面上的事件函数.

    有什么解决方法么?

    直接用监听事件?

    还是我这个操作本来就不是这么干的??

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5921 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 02:51 · PVG 10:51 · LAX 19:51 · JFK 22:51
    ♥ Do have faith in what you're doing.