首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >microsoft用于团队渲染英雄卡的旋转木马

microsoft用于团队渲染英雄卡的旋转木马
EN

Stack Overflow用户
提问于 2019-12-04 09:05:08
回答 2查看 667关注 0票数 1

我有下面的代码来渲染多张英雄卡片

代码语言:javascript
复制
 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] });

这会呈现一张又一张的卡片。我怎么把它转换成旋转木马?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-12-05 04:42:14

为了别人的利益,我现在就是这样做的

代码语言:javascript
复制
 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);
票数 2
EN

Stack Overflow用户

发布于 2019-12-04 10:02:50

您需要获取所有附件,将它们附加到要发送的回复中,并将附件布局设置为旋转木马。以下是如何实现这一目标:

var reply=activity.CreateReply(); reply.attachment=GetAttachments(); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel;

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59172321

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档