使用"yo office"创建的加载项中的点击事件被所有打开的文档调用 [英] On-click event in Add-in created with "yo office" gets invoked for all open documents

查看:163
本文介绍了使用"yo office"创建的加载项中的点击事件被所有打开的文档调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用YO OFFICE创建了基于React的Word JS插件.

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

我注意到的是,当我打开两个不同的word文档(word,在线单词,mix'n'match)并加载了我的插件时,与一个实例的交互传播到了另一个实例.

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?

推荐答案

"Yo office"使用BrowserSync进行调试,它具有在您更改JavaScript时自动刷新页面的良好效果,但也具有这种(奇怪的)效果(尽管我认为这是从BrowserSync的角度来看是有意设计的".)

"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).

您可能可以禁用BrowserSync,尽管可能需要重新布线.

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...

这篇关于使用"yo office"创建的加载项中的点击事件被所有打开的文档调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆