我正在开发一个Outlook Add-in
TypeScript Angular插件。我将我的加载项部署到Azure,它运行良好。我在Pinned mode
中swapping between emails and folders
(收件箱/已发送项目等(时收到错误(屏幕截图供参考(。它在正常模式下工作良好,只有在启用固定模式和交换不同邮件时才会出现问题。
环境:Outlook on Windows
一段Manifest
代码:
<OfficeTab id="messageReadTab">
<Group id="messageReadTab.mainGroup">
<Label resid="GroupLabel"/>
<Control xsi:type="Button" id="openSidebarReadButton">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url"/>
<SupportsPinning>true</SupportsPinning>
</Action>
</Control>
</Group>
</OfficeTab>
下面是我的code snippet:
Office.context.mailbox.addHandlerAsync(
Office.EventType.ItemChanged,
function (eventArgs) {
setTimeout(() => {
window.location.reload();
_this.homeDetails = new Array<any>();
_this.getNewMailToCcRecepEdit();
_this.loadIninailCalls();
}, 500);
},
function (asyncResult) {
// window.location.reload();
}
错误:我面临此错误,声明:对不起,我们无法加载加载项。请确保您具有网络和/或Internet连接。单击";重试";一旦您恢复在线
我甚至尝试在我的本地机器中重新安装Dev certificates
,正如这里提到的那样来解决这个问题,但没有成功
有人能指导我吗?
如果需要,我可以共享我的部分清单文件。
不要使用window.location.reload。使用pinnable窗格的好处之一是向您发送一个事件,这样您就不必再次重新加载所有HTML/JS。很可能是重新加载导致了问题。
如果这不是问题所在,那么很可能是事件处理程序代码中的其他原因造成的。您可以尝试系统地删除/添加事件处理程序中的代码,看看罪魁祸首是什么。