问题
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