Outlook 加载项的常用 JavaScript 函数
我有一个 Outlook 插件可以自动插入签名。
对于桌面客户端,manifest.xml 仅引用 1 个 javascript 文件,因此我需要将所有内容放入 1 个文件中。
但是,我想重用它在任务窗格中包含的一些函数,这些函数使用另一组 Javascript 文件。
有没有办法创建一个可以包含在任何地方的 common.js 文件?
谢谢
I have an Outlook Add-ins to automatically insert signature.
With desktop client, manifest.xml refers to only 1 javascript file, so I need to put everything in 1 single file.
However, I want to reuse some of the function it contains in the taskpane, which use another set of Javascript files.
Is there a way to create a common.js file that would be included everywhere?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建专门用于自动插入签名的 JS 文件,然后将该文件包含在任务窗格的 HTML 中。只需确保此 javascript 文件仅包含 ES6 代码,并且主要包含您希望在签名插入和加载项的任务窗格部分之间共享的 API 调用。另外,将其包含在任务窗格 HTML 文件中,位于任务窗格 JS 文件之后。
或者,可以在此处放置 2 个单独的文件,以避免在将来更新加载项时意外损坏加载项的一部分。
You can create a JS file specifically for automatically inserting the signature, and then include that file in the HTML for the taskpane. Just ensure that this javascript file only contains ES6 code, and mainly API calls that you want to be shared between the signature insertion and the taskpane parts of your add-in. Also, include it in the taskpane HTML file, after the taskpane JS file.
Alternatively, it is OK to have 2 separate files here to avoid accidentally breaking one part of your add-in when you make future updates to it.