On-click event in Add-in created with “yo office” gets invoked for all open documents

一世执手 提交于 2019-12-24 06:40:53

问题


I created react-based word JS plugin with YO OFFICE.

What I noticed is that when I open two different word documents (word, online word, mix'n'match) with my plugin loaded then interactions with one instance propagate to another instance.

So, context actions supposed to be applied for one word document get applied to all open documents. This is not expected.

Any ideas what I'm doing wrong?


回答1:


"Yo office" uses BrowserSync for debugging, which has the nice effect of automatically refreshing the page anytime you change your JavaScript, but also has this (strange) effect (though I believe it's "by design" from BrowserSync's perspective).

You can probably disable BrowserSync, though it may require a bit of re-wiring.

You can also rest assured that outside of the debug session (I.e., when deployed), this will not happen...



来源:https://stackoverflow.com/questions/44481806/on-click-event-in-add-in-created-with-yo-office-gets-invoked-for-all-open-docu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!