在按钮上查看网页点击微软团队中的英雄卡片 [英] View webpage on button click on Hero Card in Microsoft Teams
本文介绍了在按钮上查看网页点击微软团队中的英雄卡片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个在MS团队中运行的邮件扩展。
搜索列表显示Hero Card
。
选择其中一个时,聊天中会显示类似以下内容。
显示按钮的部分代码:
...
heroCard.content.buttons = [{
type: 'invoke',
title: 'Open Attachment',
value: {
type: "task/fetch",
messageId: "12345",
}
}];
我希望在单击显示文档的Open Attachment
时运行我的角度应用。
推荐答案
我想出了使用Microsoft Docs: Use task modules from bots
继续的方法首先,我需要调整英雄卡按钮以传递我的数据。
...
heroCard.content.buttons = [{
type: 'invoke',
title: 'Open Attachment',
value: {
type: "task/fetch",
messageId: "12345",
data: attachments
}
}];
第二件事是处理FETCH请求:
async handleTeamsTaskModuleFetch(context, action) {
var attachments = action.data.data
return {
task: {
type: 'continue',
value: {
height: 400,
width: 400,
title: 'View Documents',
url: `https://example.io?data=${attachments}`
}
}
};
}
注意:URL必须位于清单的有效域中,否则您将看到空白页面。
以下是最终输出:
这篇关于在按钮上查看网页点击微软团队中的英雄卡片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文