我有下面的代码来渲染多张英雄卡片
const hcard = CardFactory.heroCard(
'Neeti Sharma',
'CEO, Moblize.it LLC',
null,
[
{
type: ActionTypes.MessageBack,
title: 'Call',
value: null,
text: 'UpdateCardAction'
},
{
type: ActionTypes.MessageBack,
title: 'Email',
value: null,
text: 'email'
}
]);
await context.sendActivity({ attachments: [hcard, hcard] });这会呈现一张又一张的卡片。我怎么把它转换成旋转木马?
发布于 2019-12-05 04:42:14
为了别人的利益,我现在就是这样做的
const hcard = CardFactory.heroCard(
card._firstName + ' ' + card._lastName,
card._jobTitle + ', ' + card._dept,
null,
[
{
type: ActionTypes.MessageBack,
title: 'Call',
value: null,
text: 'UpdateCardAction'
},
{
type: ActionTypes.MessageBack,
title: 'Email',
value: null,
text: 'email'
}
]);
cardArr.push(hcard)
}
console.log("all the cards are::::" + JSON.stringify(rspVal))
const reply = {
"attachments" : cardArr,
"attachmentLayout" : AttachmentLayoutTypes.Carousel
}
await context.sendActivity(reply);发布于 2019-12-04 10:02:50
您需要获取所有附件,将它们附加到要发送的回复中,并将附件布局设置为旋转木马。以下是如何实现这一目标:
var reply=activity.CreateReply(); reply.attachment=GetAttachments(); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel;
https://stackoverflow.com/questions/59172321
复制相似问题